Azure: correct default tags value for VMs

In case tags are not supplied when the vm is created, the Azure
API will not return an entry for them.  Supply an appropriate
default value.

Change-Id: I036c3560903ae9a503fd5b9fdae44bcde175babc
This commit is contained in:
James E. Blair
2021-10-19 13:24:16 -07:00
parent 3d26835858
commit 8dad84df20

View File

@@ -45,7 +45,7 @@ class AzureInstance(statemachine.Instance):
def __init__(self, vm, nic=None, public_ipv4=None,
public_ipv6=None, sku=None):
self.external_id = vm['name']
self.metadata = vm['tags'] or {}
self.metadata = vm.get('tags', {})
self.private_ipv4 = None
self.private_ipv6 = None
self.public_ipv4 = None