Skip to content

Fix logic bug in Get-AzureRmVMDiskEncryptionStatus #6431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ResourceManager/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Current Release
* `Get-AzureRmVmDiskEncryptionStatus` fixes an issue observed for VMs with no data disks
* Update Compute client library version to fix following cmdlets
- Grant-AzureRmDiskAccess
- Grant-AzureRmSnapshotAccess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ function Test-AzureDiskEncryptionExtensionSinglePass
$status = Get-AzureRmVmDiskEncryptionStatus -ResourceGroupName $vm.ResourceGroupName -VMName $vm.Name
Assert-NotNull $status
Assert-AreEqual $status.OsVolumeEncrypted Encrypted
Assert-AreEqual $status.DataVolumesEncrypted NotEncrypted
Assert-AreEqual $status.DataVolumesEncrypted Unknown

# verify encryption settings
$settings = $status.OsVolumeEncryptionSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ public override void ExecuteCmdlet()

// retrieve encryption state using per-disk instance status and report if successful
AzureDiskEncryptionStatusContext encryptionStatus = GetStatusFromInstanceView();
if (encryptionStatus != null && !(encryptionStatus.OsVolumeEncrypted==EncryptionStatus.Unknown || encryptionStatus.DataVolumesEncrypted==EncryptionStatus.Unknown))
if (encryptionStatus != null && (encryptionStatus.OsVolumeEncrypted!=EncryptionStatus.Unknown || encryptionStatus.DataVolumesEncrypted!=EncryptionStatus.Unknown))
{
encryptionStatus.ProgressMessage = progressMessage;
WriteObject(encryptionStatus);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert changes to the psm1 file below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maddieclayton all checks have passed with the reverted file

Expand Down