Skip to content

Commit 3c43e22

Browse files
author
Sudhakara Reddy Evuri
committed
Merge pull request #3 from andyliuliming/AzureDiskEncryption
remove extra parameters.
2 parents 3eebd4f + 8451665 commit 3c43e22

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

src/ResourceManager/Compute/Commands.Compute/Extension/AzureDiskEncryption/SetAzureDiskEncryptionExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ private void CreateVMBackupForLinx()
379379
string tag = string.Format("{0}{1}", "AzureEnc", Guid.NewGuid().ToString());
380380
// this would create shapshot only for Linux box. and we should wait for the snapshot found.
381381
azureBackupExtensionUtil.CreateSnapshotForDisks(vmConfig, tag, this);
382-
383-
WriteInformation(new InformationRecord(string.Format("one snapshot for disks are created with tag,{0}", tag), string.Empty));
382+
WriteWarning(string.Format("one snapshot for disks are created with tag,{0}, you can use {1}-{2} to remove it.", tag, VerbsCommon.Remove,
383+
ProfileNouns.AzureVMBackup));
384384
}
385385
catch (AzureVMBackupException e)
386386
{

src/ResourceManager/Compute/Commands.Compute/Extension/AzureVMBackup/AzureVMBackupExtensionUtil.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ private List<string> GetDiskBlobUris(VirtualMachine virtualMachineResponse)
6565
private string GetBase64Encoding(object obj)
6666
{
6767
string plainText = JsonConvert.SerializeObject(obj);
68-
Console.WriteLine(plainText);
6968
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
7069
string base64EncodedPrivateConfig = System.Convert.ToBase64String(plainTextBytes);
7170
return base64EncodedPrivateConfig;
@@ -172,8 +171,7 @@ public void RemoveSnapshot(AzureVMBackupConfig vmConfig, string snapshotTag, Vir
172171
List<string> blobUris = this.GetDiskBlobUris(virtualMachineResponse.VirtualMachine);
173172

174173
Dictionary<string, string> snapshotQuery = new Dictionary<string, string>();
175-
snapshotQuery.Add(backupExtensionMetadataName, snapshotTag);
176-
List<CloudPageBlob> snapshots = FindSnapshot(blobUris, snapshotQuery, storageCredentialsFactory);
174+
List<CloudPageBlob> snapshots = this.FindSnapshot(blobUris, snapshotQuery, storageCredentialsFactory);
177175
foreach (CloudPageBlob snapshot in snapshots)
178176
{
179177
snapshot.Delete();

src/ResourceManager/Compute/Commands.Compute/Extension/AzureVMBackup/RemoveAzureVMBackup.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,6 @@ public class RemoveAzureVMBackup : VirtualMachineExtensionBaseCmdlet
6161
[ValidateNotNullOrEmpty]
6262
public string VMName { get; set; }
6363

64-
[Alias("ExtensionName")]
65-
[Parameter(
66-
Mandatory = true,
67-
Position = 2,
68-
ValueFromPipelineByPropertyName = true,
69-
HelpMessage = "The extension name.")]
70-
[ValidateNotNullOrEmpty]
71-
public string Name { get; set; }
72-
73-
[Parameter(
74-
Mandatory = true,
75-
Position = 6,
76-
ValueFromPipelineByPropertyName = true,
77-
HelpMessage = "The location.")]
78-
[ValidateNotNullOrEmpty]
79-
public string Location { get; set; }
80-
8164
[Parameter(ValueFromPipelineByPropertyName = true)]
8265
public string Tag { get; set; }
8366

0 commit comments

Comments
 (0)