Don't output anything if no results and --raw

This commit is contained in:
Joshua Boniface 2020-07-11 11:38:13 -04:00
parent be405caa11
commit ad45f6097f
1 changed files with 6 additions and 0 deletions

View File

@ -550,6 +550,9 @@ def node_list(limit, target_daemon_state, target_coordinator_state, target_domai
retcode, retdata = pvc_node.node_list(config, limit, target_daemon_state, target_coordinator_state, target_domain_state) retcode, retdata = pvc_node.node_list(config, limit, target_daemon_state, target_coordinator_state, target_domain_state)
if retcode: if retcode:
retdata = pvc_node.format_list(retdata, raw) retdata = pvc_node.format_list(retdata, raw)
else:
if raw:
retdata = ""
cleanup(retcode, retdata) cleanup(retcode, retdata)
############################################################################### ###############################################################################
@ -1076,6 +1079,9 @@ def vm_list(target_node, target_state, limit, raw):
retcode, retdata = pvc_vm.vm_list(config, limit, target_node, target_state) retcode, retdata = pvc_vm.vm_list(config, limit, target_node, target_state)
if retcode: if retcode:
retdata = pvc_vm.format_list(config, retdata, raw) retdata = pvc_vm.format_list(config, retdata, raw)
else:
if raw:
retdata = ""
cleanup(retcode, retdata) cleanup(retcode, retdata)
############################################################################### ###############################################################################