Skip to content
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
4 changes: 4 additions & 0 deletions src/vm-repair/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

Release History
===============
0.5.2
++++++
Fix bug in _fetch_encryption_settings, add check for EncryptionSettingsCollection.enabled is false.

0.5.1
++++++
Updated exsiting privateIpAddress field to privateIPAddress and privateIpAllocationMethod to privateIPAllocationMethod.
Expand Down
8 changes: 6 additions & 2 deletions src/vm-repair/azext_vm_repair/repair_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,15 @@ def _fetch_encryption_settings(source_vm):
return Encryption.NONE, key_vault, kekurl, secreturl

disk_id = source_vm.storage_profile.os_disk.managed_disk.id
show_disk_command = 'az disk show --id {i} --query [encryptionSettingsCollection,encryptionSettingsCollection.encryptionSettings[].diskEncryptionKey.sourceVault.id,encryptionSettingsCollection.encryptionSettings[].keyEncryptionKey.keyUrl,encryptionSettingsCollection.encryptionSettings[].diskEncryptionKey.secretUrl] -o json' \
show_disk_command = 'az disk show --id {i} --query [encryptionSettingsCollection,encryptionSettingsCollection.enabled,encryptionSettingsCollection.encryptionSettings[].diskEncryptionKey.sourceVault.id,encryptionSettingsCollection.encryptionSettings[].keyEncryptionKey.keyUrl,encryptionSettingsCollection.encryptionSettings[].diskEncryptionKey.secretUrl] -o json' \
.format(i=disk_id)
encryption_type, key_vault, kekurl, secreturl = loads(_call_az_command(show_disk_command))
encryption_type, enabled, key_vault, kekurl, secreturl = loads(_call_az_command(show_disk_command))
if [encryption_type, key_vault, kekurl] == [None, None, None]:
return Encryption.NONE, key_vault, kekurl, secreturl
if not enabled:
return Encryption.NONE, key_vault, kekurl, secreturl
if enabled.tolower() == 'false':
return Encryption.NONE, key_vault, kekurl, secreturl
if kekurl == []:
key_vault, secreturl = key_vault[0], secreturl[0]
return Encryption.SINGLE_WITHOUT_KEK, key_vault, kekurl, secreturl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ def test_vmrepair_WinSinglepassKekEncryptedManagedDiskCreateRestore(self, resour
assert source_vm['storageProfile']['osDisk']['name'] == result['copied_disk_name']


@pytest.mark.linuxencryption
class LinuxSinglepassKekEncryptedManagedDiskCreateRestoreTest(LiveScenarioTest):

@ResourceGroupPreparer(location='westus2')
Expand Down
2 changes: 1 addition & 1 deletion src/vm-repair/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from codecs import open
from setuptools import setup, find_packages

VERSION = "0.5.1"
VERSION = "0.5.2"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down