Use get() instead of direct dict reference
This commit is contained in:
parent
a0542d61d0
commit
2d2bdb879e
|
@ -171,9 +171,9 @@ class MetadataAPIInstance(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Get our real information on the host; now we can start querying about it
|
# Get our real information on the host; now we can start querying about it
|
||||||
client_hostname = host_information['hostname']
|
client_hostname = host_information.get('hostname', None)
|
||||||
client_macaddr = host_information['mac_address']
|
client_macaddr = host_information.get('mac_address', None)
|
||||||
client_ipaddr = host_information['ip4_address']
|
client_ipaddr = host_information.get('ip4_address', None)
|
||||||
|
|
||||||
# Find the VM with that MAC address - we can't assume that the hostname is actually right
|
# Find the VM with that MAC address - we can't assume that the hostname is actually right
|
||||||
_discard, vm_list = pvc_vm.get_list(self.zk_conn, None, None, None)
|
_discard, vm_list = pvc_vm.get_list(self.zk_conn, None, None, None)
|
||||||
|
|
Loading…
Reference in New Issue