Skip to content

Commit a095646

Browse files
committed
bugs 1346922, 1346908: spaces in generated file name, naming for a cmdlet
1 parent e7442c9 commit a095646

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
<Compile Include="Service\GetAzureSiteRecoveryNetwork.cs" />
150150
<Compile Include="Service\CreateAzureSiteRecoveryRecoveryPlan.cs" />
151151
<Compile Include="Service\GetAzureSiteRecoveryRecoveryPlanFile.cs" />
152-
<Compile Include="Service\GetAzureSiteRecoveryVaultCredential.cs" />
152+
<Compile Include="Service\GetAzureSiteRecoveryVaultSettingsFile.cs" />
153153
<Compile Include="Service\RemoveAzureSiteRecoveryRecoveryPlan.cs" />
154154
<Compile Include="Service\GetAzureSiteRecoveryProtectionEntity.cs" />
155155
<Compile Include="Service\RestartAzureSiteRecoveryJob.cs" />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private async Task<string> GetChannelIntegrityKey()
157157
{
158158
// In case this condition is true that means the credential was first generated in portal
159159
// and hence can not be fetched here.
160-
throw new CloudException(Resources.VaultCredentialGenerationUnSupported);
160+
throw new CloudException(Resources.VaultSettingsGenerationUnSupported);
161161
}
162162
}
163163

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

Lines changed: 6 additions & 6 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ ClientRequestId: {3}</value>
203203
<data name="AzureVMNetworkIsNotAssociatedWithTheSubscription" xml:space="preserve">
204204
<value>AzureVMNetwork {0} is not associated with the Subscription {1}</value>
205205
</data>
206-
<data name="VaultCredentialGenerationUnSupported" xml:space="preserve">
207-
<value>Cannot generate vault credentials for this vault. Download it from the Azure Portal.</value>
206+
<data name="VaultSettingsGenerationUnSupported" xml:space="preserve">
207+
<value>Cannot generate vault settings file for this vault. Download it from the Azure Portal.</value>
208208
</data>
209209
<data name="VaultCreationSuccessMessage" xml:space="preserve">
210210
<value>Vault has been created</value>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ namespace Microsoft.Azure.Commands.RecoveryServices
2828
/// <summary>
2929
/// Retrieves Azure Site Recovery Server.
3030
/// </summary>
31-
[Cmdlet(VerbsCommon.Get, "AzureSiteRecoveryVaultCredential", DefaultParameterSetName = ASRParameterSets.ByObject)]
32-
[OutputType(typeof(VaultCredentialOutput))]
33-
public class GetVaultCredentialsFile : RecoveryServicesCmdletBase
31+
[Cmdlet(VerbsCommon.Get, "AzureSiteRecoveryVaultSettingsFile", DefaultParameterSetName = ASRParameterSets.ByObject)]
32+
[OutputType(typeof(VaultSettingsFilePath))]
33+
public class GetAzureSiteRecoveryVaultSettingsFile : RecoveryServicesCmdletBase
3434
{
3535
/// <summary>
3636
/// Expiry in hours for generated certificate.
@@ -158,7 +158,7 @@ private void GetByObject()
158158
string fileName = this.GenerateFileName();
159159

160160
// write the content to a file.
161-
VaultCredentialOutput output = new VaultCredentialOutput()
161+
VaultSettingsFilePath output = new VaultSettingsFilePath()
162162
{
163163
FilePath = Utilities.WriteToFile<ASRVaultCreds>(vaultCreds, filePath, fileName)
164164
};
@@ -174,14 +174,14 @@ private void GetByObject()
174174
private string GenerateFileName()
175175
{
176176
string fileName;
177-
177+
string format = "yyyy-MM-ddTHH-mm-ss";
178178
if (string.IsNullOrEmpty(this.Site.Name))
179179
{
180-
fileName = string.Format("{0}_{1}.VaultCredentials", this.Vault.Name, DateTime.UtcNow.ToLongDateString());
180+
fileName = string.Format("{0}_{1}.VaultCredentials", this.Vault.Name, DateTime.UtcNow.ToString(format));
181181
}
182182
else
183183
{
184-
fileName = string.Format("{0}_{1}_{2}.VaultCredentials", this.Site.Name, this.Vault.Name, DateTime.UtcNow.ToLongDateString());
184+
fileName = string.Format("{0}_{1}_{2}.VaultCredentials", this.Site.Name, this.Vault.Name, DateTime.UtcNow.ToString(format));
185185
}
186186

187187
return fileName;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,16 +1203,16 @@ public ASRServiceError(ServiceError serviceError)
12031203
}
12041204

12051205
/// <summary>
1206-
/// Class to define the output of the vault credential generation.
1206+
/// Class to define the output of the vault settings file generation.
12071207
/// </summary>
1208-
public class VaultCredentialOutput
1208+
public class VaultSettingsFilePath
12091209
{
12101210
#region Constructor
12111211

12121212
/// <summary>
1213-
/// Initializes a new instance of the <see cref="VaultCredentialOutput" /> class
1213+
/// Initializes a new instance of the <see cref="VaultSettingsFilePath" /> class
12141214
/// </summary>
1215-
public VaultCredentialOutput()
1215+
public VaultSettingsFilePath()
12161216
{
12171217
}
12181218

0 commit comments

Comments
 (0)