Lint: F841 local variable '<variable>' is assigned to but never used

This commit is contained in:
2020-11-06 21:13:13 -05:00
parent 98a573bbc7
commit 5da314902f
17 changed files with 23 additions and 58 deletions

View File

@ -174,19 +174,15 @@ class MetadataAPIInstance(object):
pass
# Get our real information on the host; now we can start querying about it
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)
vm_name = None
vm_details = dict()
for vm in vm_list:
try:
for network in vm.get('networks'):
if network.get('mac', None) == client_macaddr:
vm_name = vm.get('name')
vm_details = vm
except Exception:
pass