List names instead of UUIDs

This commit is contained in:
Joshua Boniface 2019-03-12 21:35:33 -04:00
parent c4a97f04a7
commit 717e518deb
1 changed files with 3 additions and 1 deletions

View File

@ -503,6 +503,7 @@ def get_list(zk_conn, node, limit, raw):
full_vm_list = zkhandler.listchildren(zk_conn, '/domains') full_vm_list = zkhandler.listchildren(zk_conn, '/domains')
vm_list = [] vm_list = []
vm_list_names = []
vm_list_output = [] vm_list_output = []
vm_node = {} vm_node = {}
@ -520,6 +521,7 @@ def get_list(zk_conn, node, limit, raw):
# Check we don't match the limit # Check we don't match the limit
name = zkhandler.readdata(zk_conn, '/domains/{}'.format(vm)) name = zkhandler.readdata(zk_conn, '/domains/{}'.format(vm))
vm_list_names.append(name)
vm_node[vm] = zkhandler.readdata(zk_conn, '/domains/{}/node'.format(vm)) vm_node[vm] = zkhandler.readdata(zk_conn, '/domains/{}/node'.format(vm))
if limit != None: if limit != None:
try: try:
@ -553,7 +555,7 @@ def get_list(zk_conn, node, limit, raw):
vm_list.append(vm) vm_list.append(vm)
if raw: if raw:
click.echo('\n'.join(vm_list)) click.echo('\n'.join(vm_list_names))
return True, '' return True, ''
# Gather information for printing # Gather information for printing