From 2d2bdb879e4d85f8b68fbdfc773f6dc58ec00715 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 6 Jan 2020 16:34:39 -0500 Subject: [PATCH] Use get() instead of direct dict reference --- node-daemon/pvcd/MetadataAPIInstance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node-daemon/pvcd/MetadataAPIInstance.py b/node-daemon/pvcd/MetadataAPIInstance.py index 3047cd8d..e6d38c03 100644 --- a/node-daemon/pvcd/MetadataAPIInstance.py +++ b/node-daemon/pvcd/MetadataAPIInstance.py @@ -171,9 +171,9 @@ class MetadataAPIInstance(object): pass # Get our real information on the host; now we can start querying about it - client_hostname = host_information['hostname'] - client_macaddr = host_information['mac_address'] - client_ipaddr = host_information['ip4_address'] + client_hostname = host_information.get('hostname', None) + client_macaddr = host_information.get('mac_address', None) + 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 _discard, vm_list = pvc_vm.get_list(self.zk_conn, None, None, None)