Skip to content

Commit ce314ad

Browse files
committed
Revert "bug1680974"
This reverts commit 9afabcd.
1 parent 3758cba commit ce314ad

File tree

4 files changed

+4
-32
lines changed

4 files changed

+4
-32
lines changed

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

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ public RecoveryServicesManagementClient GetRecoveryServicesClient
7979
/// </summary>
8080
private RecoveryServicesManagementClient recoveryServicesClient;
8181

82-
private string currentSubscriptionId;
83-
8482
/// <summary>
8583
/// Initializes a new instance of the <see cref="PSRecoveryServicesClient" /> class with
8684
/// required current subscription.
@@ -89,7 +87,6 @@ public RecoveryServicesManagementClient GetRecoveryServicesClient
8987
public PSRecoveryServicesClient(AzureProfile azureProfile, AzureSubscription azureSubscription)
9088
{
9189
this.Profile = azureProfile;
92-
this.currentSubscriptionId = azureSubscription.Id.ToString();
9390
this.recoveryServicesClient =
9491
AzureSession.ClientFactory.CreateClient<RecoveryServicesManagementClient>(azureProfile, azureSubscription, AzureEnvironment.Endpoint.ServiceManagement);
9592
}
@@ -157,17 +154,6 @@ public bool ValidateVaultSettings(
157154
return true;
158155
}
159156

160-
public bool ValidateVaultContext(
161-
string subscriptionId)
162-
{
163-
if (0 == string.CompareOrdinal(this.currentSubscriptionId, subscriptionId))
164-
{
165-
return true;
166-
}
167-
168-
return false;
169-
}
170-
171157
/// <summary>
172158
/// Site Recovery requests that go to on-premise components (like the Provider installed
173159
/// in VMM) require an authentication token that is signed with the vault key to indicate
@@ -227,10 +213,10 @@ public CustomRequestHeaders GetRequestHeaders(bool shouldSignRequest = true)
227213
private SiteRecoveryManagementClient GetSiteRecoveryClient()
228214
{
229215
CloudServiceListResponse services = this.recoveryServicesClient.CloudServices.List();
230-
if (!this.ValidateVaultContext(asrVaultCreds.SubscriptionId))
231-
{
232-
throw new ArgumentException(Properties.Resources.InvalidVaultContext);
233-
}
216+
this.ValidateVaultSettings(
217+
asrVaultCreds.ResourceName,
218+
asrVaultCreds.CloudServiceName,
219+
services);
234220

235221
CloudService selectedCloudService = null;
236222
Vault selectedResource = null;

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/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/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Properties/Resources.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,4 @@ Please provide a storage account with the same location as that of the vault.</v
256256
<data name="StorageAccountValidationUnsuccessful" xml:space="preserve">
257257
<value>The Subscription or Storage account couldn’t be validated. For failovers to be successful, the Subscription should belong to your account, the Storage account to the Subscription and Storage account location must be the same as location of your Vault.</value>
258258
</data>
259-
<data name="InvalidVaultContext" xml:space="preserve">
260-
<value>Imported Vault is not associated with the Current Subscription.</value>
261-
</data>
262259
</root>

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/lib/Utilities.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ public static void UpdateVaultSettings(ASRVaultCreds asrVaultCreds)
112112
asrVaultCreds.CloudServiceName;
113113
PSRecoveryServicesClient.asrVaultCreds.ChannelIntegrityKey =
114114
asrVaultCreds.ChannelIntegrityKey;
115-
PSRecoveryServicesClient.asrVaultCreds.SubscriptionId =
116-
asrVaultCreds.SubscriptionId;
117115
}
118116
}
119117

0 commit comments

Comments
 (0)