Skip to content

Commit 13edbe5

Browse files
committed
Adding strings to resex file
1 parent b18dc35 commit 13edbe5

File tree

3 files changed

+79
-6
lines changed

3 files changed

+79
-6
lines changed

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

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

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,22 @@ Please provide a storage account with the same location as that of the vault.</v
277277
<data name="SiteNotFound" xml:space="preserve">
278278
<value>Site {0} is not associated with the Vault {1}</value>
279279
</data>
280+
<data name="BackupVaultSerialized" xml:space="preserve">
281+
<value>RecoveryService - Backup Vault - Successfully serialized the file content</value>
282+
</data>
283+
<data name="ExecutingGetVaultCredCmdlet" xml:space="preserve">
284+
<value>Executing cmdlet with SubscriptionId = {0}, ResourceGroupName = {1}, ResourceName = {2}, TargetLocation = {3}</value>
285+
</data>
286+
<data name="SavingVaultCred" xml:space="preserve">
287+
<value>Saving Vault Credentials to file : {0}</value>
288+
</data>
289+
<data name="UploadedCertToIdmgmt" xml:space="preserve">
290+
<value>RecoveryService - Successfully uploaded the certificate</value>
291+
</data>
292+
<data name="UploadingCertToIdmgmt" xml:space="preserve">
293+
<value>RecoveryService - Going to upload the certificate</value>
294+
</data>
295+
<data name="VaultCredPathException" xml:space="preserve">
296+
<value>The target location provided is not a directory. Please provide a directory.</value>
297+
</data>
280298
</root>

src/ResourceManager/RecoveryServices/Commands.RecoveryServices/Vault/GetAzureRMRecoveryServicesVaultSettingsFile.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using System.Text;
2525
using System.Globalization;
2626
using Microsoft.Azure.Management.RecoveryServices.Models;
27+
using Microsoft.Azure.Commands.RecoveryServices.Properties;
2728

2829
namespace Microsoft.Azure.Commands.RecoveryServices
2930
{
@@ -196,14 +197,14 @@ public void GetAzureRMRecoveryServicesVaultBackupCredentials()
196197
string targetLocation = string.IsNullOrEmpty(this.Path) ? Utilities.GetDefaultPath() : this.Path;
197198
if (!Directory.Exists(targetLocation))
198199
{
199-
throw new ArgumentException("The target location provided is not a directory. Please provide a directory.");
200+
throw new ArgumentException(Resources.VaultCredPathException);
200201
}
201202

202203
string subscriptionId = DefaultContext.Subscription.Id.ToString();
203204
string displayName = this.Vault.Name;
204205

205206
WriteDebug(string.Format(CultureInfo.InvariantCulture,
206-
"Executing cmdlet with SubscriptionId = {0}, ResourceGroupName = {1}, ResourceName = {2}, TargetLocation = {3}",
207+
Resources.ExecutingGetVaultCredCmdlet,
207208
subscriptionId, this.Vault.ResouceGroupName, this.Vault.Name, targetLocation));
208209

209210
// Generate certificate
@@ -214,9 +215,9 @@ public void GetAzureRMRecoveryServicesVaultBackupCredentials()
214215
try
215216
{
216217
// Upload cert into ID Mgmt
217-
WriteDebug(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Going to upload the certificate"));
218+
WriteDebug(string.Format(CultureInfo.InvariantCulture, Resources.UploadingCertToIdmgmt));
218219
acsNamespace = UploadCert(cert);
219-
WriteDebug(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Successfully uploaded the certificate"));
220+
WriteDebug(string.Format(CultureInfo.InvariantCulture, Resources.UploadedCertToIdmgmt));
220221
}
221222
catch (Exception exception)
222223
{
@@ -235,7 +236,7 @@ public void GetAzureRMRecoveryServicesVaultBackupCredentials()
235236
// prepare for download
236237
string fileName = string.Format("{0}_{1:ddd MMM dd yyyy}.VaultCredentials", displayName, DateTime.UtcNow);
237238
string filePath = System.IO.Path.Combine(targetLocation, fileName);
238-
WriteDebug(string.Format("Saving Vault Credentials to file : {0}", filePath));
239+
WriteDebug(string.Format(Resources.SavingVaultCred, filePath));
239240

240241
File.WriteAllBytes(filePath, Encoding.UTF8.GetBytes(vaultCredsFileContent));
241242

@@ -301,7 +302,7 @@ private string GenerateVaultCredsForBackup(X509Certificate2 cert, string subscri
301302
DataContractSerializer serializer = new DataContractSerializer(typeof(BackupVaultCreds));
302303
serializer.WriteObject(writer, backupVaultCreds);
303304

304-
WriteDebug(string.Format(CultureInfo.InvariantCulture, "RecoveryService - Backup Vault - Successfully serialized the file content"));
305+
WriteDebug(string.Format(CultureInfo.InvariantCulture, Resources.BackupVaultSerialized));
305306
}
306307

307308
return Encoding.UTF8.GetString(output.ToArray());

0 commit comments

Comments
 (0)