Skip to content

Commit 2477612

Browse files
author
Kamran Khan
committed
Set this.Name if it it's null
1 parent b3e6cb6 commit 2477612

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ private VirtualMachineExtension GetVmExtensionParameters(VirtualMachine vmParame
108108

109109
private bool IsExtensionInstalled(OSType currentOSType)
110110
{
111+
if (OSType.Windows.Equals(currentOSType))
112+
{
113+
this.Name = this.Name ?? AzureDiskEncryptionExtensionContext.ExtensionDefaultName;
114+
}
115+
else if (OSType.Linux.Equals(currentOSType))
116+
{
117+
this.Name = this.Name ?? AzureDiskEncryptionExtensionContext.LinuxExtensionDefaultName;
118+
}
111119

112120
AzureOperationResponse<VirtualMachineExtension> extensionResult = this.VirtualMachineExtensionClient.GetWithInstanceView(this.ResourceGroupName, this.VMName, this.Name);
113121
if (extensionResult == null)

0 commit comments

Comments
 (0)