Skip to content

Commit 74850f3

Browse files
authored
Merge pull request Azure#2636 from jasper-schneider/removeExistCheck
Remove exist check from New-AzureRmBatchAccount
2 parents 9f31a39 + 910fe70 commit 74850f3

File tree

7 files changed

+27
-941
lines changed

7 files changed

+27
-941
lines changed

src/ResourceManager/AzureBatch/Commands.Batch.Test/Commands.Batch.Test.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@
329329
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchAccountTests\TestCreateAndRemoveBatchAccountViaPiping.json">
330330
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
331331
</None>
332-
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchAccountTests\TestCreateExistingBatchAccount.json">
333-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
334-
</None>
335332
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchAccountTests\TestCreatesNewBatchAccount.json">
336333
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
337334
</None>

src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/BatchAccountTests.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ public void TestCreatesNewBatchAccount()
3535
BatchController.NewInstance.RunPsTest("Test-CreatesNewBatchAccount");
3636
}
3737

38-
[Fact]
39-
public void TestCreateExistingBatchAccount()
40-
{
41-
BatchController.NewInstance.RunPsTest("Test-CreateExistingBatchAccount");
42-
}
43-
4438
[Fact]
4539
public void TestUpdatesExistingBatchAccount()
4640
{

src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/BatchAccountTests.ps1

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,6 @@ function Test-CreatesNewBatchAccount
5757
}
5858
}
5959

60-
<#
61-
.SYNOPSIS
62-
Tests creating an account that already exists throws
63-
#>
64-
function Test-CreateExistingBatchAccount
65-
{
66-
# Setup
67-
$account = Get-BatchAccountName
68-
$resourceGroup = Get-ResourceGroupName
69-
$location = Get-BatchAccountProviderLocation
70-
71-
try
72-
{
73-
New-AzureRmResourceGroup -Name $resourceGroup -Location $location
74-
75-
# Test
76-
New-AzureRmBatchAccount -Name $account -ResourceGroupName $resourceGroup -Location $location -Tag @{Name = "testtag"; Value = "testval"}
77-
78-
Assert-Throws { New-AzureRmBatchAccount -Name $account -ResourceGroupName $resourceGroup -Location $location }
79-
}
80-
finally
81-
{
82-
# Cleanup
83-
Clean-BatchAccountAndResourceGroup $account $resourceGroup
84-
}
85-
}
86-
8760
<#
8861
.SYNOPSIS
8962
Tests updating existing Batch account

src/ResourceManager/AzureBatch/Commands.Batch.Test/SessionRecords/Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchAccountTests/TestCreateExistingBatchAccount.json

Lines changed: 0 additions & 859 deletions
This file was deleted.

src/ResourceManager/AzureBatch/Commands.Batch/Models/BatchClient.Accounts.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ public partial class BatchClient
4040
/// <returns>A BatchAccountContext object representing the new account</returns>
4141
public virtual BatchAccountContext CreateAccount(string resourceGroupName, string accountName, string location, Hashtable[] tags, string autoStorageAccountId)
4242
{
43-
// use the group lookup to validate whether account already exists. We don't care about the returned
44-
// group name nor the exception
45-
if (GetGroupForAccountNoThrow(accountName) != null)
46-
{
47-
throw new CloudException(Resources.AccountAlreadyExists);
48-
}
49-
5043
Dictionary<string, string> tagDictionary = Helpers.CreateTagDictionary(tags, validate: true);
5144

5245
AutoStorageBaseProperties autoStorage = (string.IsNullOrEmpty(autoStorageAccountId)) ? null : new AutoStorageBaseProperties

src/ResourceManager/AzureBatch/Commands.Batch/Properties/Resources.Designer.cs

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/AzureBatch/Commands.Batch/Properties/Resources.resx

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<root>
3-
<!--
4-
Microsoft ResX Schema
5-
3+
<!--
4+
Microsoft ResX Schema
5+
66
Version 2.0
7-
8-
The primary goals of this format is to allow a simple XML format
9-
that is mostly human readable. The generation and parsing of the
10-
various data types are done through the TypeConverter classes
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
1111
associated with the data types.
12-
12+
1313
Example:
14-
14+
1515
... ado.net/XML headers & schema ...
1616
<resheader name="resmimetype">text/microsoft-resx</resheader>
1717
<resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
2626
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
2727
<comment>This is a comment</comment>
2828
</data>
29-
30-
There are any number of "resheader" rows that contain simple
29+
30+
There are any number of "resheader" rows that contain simple
3131
name/value pairs.
32-
33-
Each data row contains a name, and value. The row also contains a
34-
type or mimetype. Type corresponds to a .NET class that support
35-
text/value conversion through the TypeConverter architecture.
36-
Classes that don't support this are serialized and stored with the
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
3737
mimetype set.
38-
39-
The mimetype is used for serialized objects, and tells the
40-
ResXResourceReader how to depersist the object. This is currently not
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
4141
extensible. For a given mimetype the value must be set accordingly:
42-
43-
Note - application/x-microsoft.net.object.binary.base64 is the format
44-
that the ResXResourceWriter will generate, however the reader can
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
4545
read any of the formats listed below.
46-
46+
4747
mimetype: application/x-microsoft.net.object.binary.base64
48-
value : The object must be serialized with
48+
value : The object must be serialized with
4949
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
5050
: and then encoded with base64 encoding.
51-
51+
5252
mimetype: application/x-microsoft.net.object.soap.base64
53-
value : The object must be serialized with
53+
value : The object must be serialized with
5454
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
5555
: and then encoded with base64 encoding.
5656
5757
mimetype: application/x-microsoft.net.object.bytearray.base64
58-
value : The object must be serialized into a byte array
58+
value : The object must be serialized into a byte array
5959
: using a System.ComponentModel.TypeConverter
6060
: and then encoded with base64 encoding.
6161
-->
@@ -117,9 +117,6 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120-
<data name="AccountAlreadyExists" xml:space="preserve">
121-
<value>AccountAlreadyExists: Account already exists.</value>
122-
</data>
123120
<data name="AccountAndKeyInUse" xml:space="preserve">
124121
<value>Executing cmdlet with Batch account {0} with its {1} key. To change which key to use, set the KeyInUse property on the BatchAccountContext.</value>
125122
</data>

0 commit comments

Comments
 (0)