Skip to content

Commit 1e4af70

Browse files
author
Maddie Clayton
authored
Merge pull request #6431 from ejarvi/ade-status-fix
Fix logic bug in Get-AzureRmVMDiskEncryptionStatus
2 parents 0e03ba6 + 2001552 commit 1e4af70

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/ResourceManager/Compute/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* `Get-AzureRmVmDiskEncryptionStatus` fixes an issue observed for VMs with no data disks
2122
* Update Compute client library version to fix following cmdlets
2223
- Grant-AzureRmDiskAccess
2324
- Grant-AzureRmSnapshotAccess

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineExtensionTests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ function Test-AzureDiskEncryptionExtensionSinglePass
10521052
$status = Get-AzureRmVmDiskEncryptionStatus -ResourceGroupName $vm.ResourceGroupName -VMName $vm.Name
10531053
Assert-NotNull $status
10541054
Assert-AreEqual $status.OsVolumeEncrypted Encrypted
1055-
Assert-AreEqual $status.DataVolumesEncrypted NotEncrypted
1055+
Assert-AreEqual $status.DataVolumesEncrypted Unknown
10561056

10571057
# verify encryption settings
10581058
$settings = $status.OsVolumeEncryptionSettings

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ public override void ExecuteCmdlet()
514514

515515
// retrieve encryption state using per-disk instance status and report if successful
516516
AzureDiskEncryptionStatusContext encryptionStatus = GetStatusFromInstanceView();
517-
if (encryptionStatus != null && !(encryptionStatus.OsVolumeEncrypted==EncryptionStatus.Unknown || encryptionStatus.DataVolumesEncrypted==EncryptionStatus.Unknown))
517+
if (encryptionStatus != null && (encryptionStatus.OsVolumeEncrypted!=EncryptionStatus.Unknown || encryptionStatus.DataVolumesEncrypted!=EncryptionStatus.Unknown))
518518
{
519519
encryptionStatus.ProgressMessage = progressMessage;
520520
WriteObject(encryptionStatus);

0 commit comments

Comments
 (0)