Skip to content

Commit 15e97f5

Browse files
committed
Merge pull request #52 from AsrOneSdk/sriramvu-dev
bug1645997 & Get-AzureSiteRecoveryVault byName
2 parents 63abe6b + a4e3683 commit 15e97f5

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

src/Common/Commands.Common/Properties/Resources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/PSRecoveryServicesClient/PSRecoveryServicesCloudServiceClient.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public IEnumerable<CloudService> GetCloudServices()
4444
public CloudService GetCloudServiceForVault(ASRVault vault)
4545
{
4646
IEnumerable<CloudService> cloudServiceList = this.GetCloudServices();
47-
CloudService cloudServiceToReturn = null;
4847

4948
foreach (var cloudService in cloudServiceList)
5049
{
@@ -56,19 +55,17 @@ public CloudService GetCloudServiceForVault(ASRVault vault)
5655
if (resource.Name.Equals(vault.Name, StringComparison.InvariantCultureIgnoreCase))
5756
{
5857
selectedVault = resource;
59-
break;
58+
return cloudService;
6059
}
6160
}
6261
}
63-
64-
if (selectedVault != null)
65-
{
66-
cloudServiceToReturn = cloudService;
67-
break;
68-
}
6962
}
7063

71-
return cloudServiceToReturn;
64+
throw new ArgumentException(
65+
string.Format(
66+
Properties.Resources.InCorrectVaultInformation,
67+
vault.Name,
68+
vault.Location));
7269
}
7370

7471
/// <summary>

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Properties/Resources.Designer.cs

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

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ ClientRequestId: {3}</value>
239239
<data name="VaultNotFound" xml:space="preserve">
240240
<value>Vault {0} is not associated with the given subscription.</value>
241241
</data>
242+
<data name="InCorrectVaultInformation" xml:space="preserve">
243+
<value>Vault information (Name: {0}, Location: {1}) is not correct</value>
244+
</data>
242245
<data name="NewProtectionProfileObjectWhatIfMessage" xml:space="preserve">
243246
<value>Creates a new in-memory protection profile association object.</value>
244247
</data>

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Service/GetAzureSiteRecoveryVault.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private void GetByName()
9292
this.Name));
9393
}
9494

95-
this.WriteVaults(vaultList);
95+
this.WriteVaults(vaultListByName);
9696
}
9797

9898
/// <summary>

0 commit comments

Comments
 (0)