clean up log messages in get_all_by_host_and_network
This commit is contained in:
parent
089cb4d696
commit
4c5cddc08b
@ -140,10 +140,10 @@ class ShellScriptSpoke(VirtualizationInterface):
|
||||
vm_list_process = run([join(current_app.root_path, 'shell_scripts/virsh-list.sh')], capture_output=True)
|
||||
self.validate_completed_process(vm_list_process)
|
||||
vms_json_string = vm_list_process.stdout.decode("utf-8")
|
||||
current_app.logger.info(f"vms_json_string: {vms_json_string}")
|
||||
#current_app.logger.info(f"vms_json_string: {vms_json_string}")
|
||||
list_of_vms = json.loads(vms_json_string)
|
||||
|
||||
current_app.logger.info(f"list_of_vms: {json.dumps(list_of_vms)}")
|
||||
#current_app.logger.info(f"list_of_vms: {json.dumps(list_of_vms)}")
|
||||
|
||||
vm_state_by_id = dict()
|
||||
for vm in list_of_vms:
|
||||
@ -152,10 +152,10 @@ class ShellScriptSpoke(VirtualizationInterface):
|
||||
net_list_process = run([join(current_app.root_path, 'shell_scripts/virsh-net-list.sh')], capture_output=True)
|
||||
self.validate_completed_process(net_list_process)
|
||||
net_list_json_string = net_list_process.stdout.decode("utf-8")
|
||||
current_app.logger.info(f"net_list_json_string: {net_list_json_string}")
|
||||
#current_app.logger.info(f"net_list_json_string: {net_list_json_string}")
|
||||
list_of_networks = json.loads(net_list_json_string)
|
||||
|
||||
current_app.logger.info(f"list_of_networks: {json.dumps(list_of_networks)}")
|
||||
#current_app.logger.info(f"list_of_networks: {json.dumps(list_of_networks)}")
|
||||
|
||||
networks = dict()
|
||||
vms_by_id = dict()
|
||||
@ -182,7 +182,7 @@ class ShellScriptSpoke(VirtualizationInterface):
|
||||
if vm['domain'] in vm_state_by_id:
|
||||
vm_state = vm_state_by_id[vm['domain']]
|
||||
else:
|
||||
current_app.logger.info(f"get_all_by_host_and_network: '{vm['domain']}' not in vm_state_by_id, defaulting to 'shut off'")
|
||||
current_app.logger.warn(f"get_all_by_host_and_network: '{vm['domain']}' not in vm_state_by_id, defaulting to 'shut off'")
|
||||
|
||||
vms_by_id[vm['domain']] = dict(macs=dict(), state=vm_state, network=network['name'])
|
||||
|
||||
@ -201,7 +201,7 @@ class ShellScriptSpoke(VirtualizationInterface):
|
||||
vm_id = vm_id_by_mac[status['mac-address']]
|
||||
vms_by_id[vm_id]['ipv4'] = status['ip-address']
|
||||
else:
|
||||
current_app.logger.info(f"get_all_by_host_and_network: {status['mac-address']} not in vm_id_by_mac")
|
||||
current_app.logger.warn(f"get_all_by_host_and_network: {status['mac-address']} not in vm_id_by_mac")
|
||||
|
||||
networks = dict()
|
||||
for vm in vms_by_id:
|
||||
|
Loading…
Reference in New Issue
Block a user