From 04c2e426472386439b4daed2aee87ac8a927ce4f Mon Sep 17 00:00:00 2001 From: bharath Date: Thu, 11 Oct 2018 00:49:04 +0530 Subject: [PATCH] Fix host-list and host-show rendering issues Change-Id: I248194b0fc1aaf776e50bb132b34bbbe0c1735bc --- gyanclient/common/utils.py | 6 +++--- gyanclient/v1/hosts_shell.py | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/gyanclient/common/utils.py b/gyanclient/common/utils.py index 44bfc59..29b3ca4 100644 --- a/gyanclient/common/utils.py +++ b/gyanclient/common/utils.py @@ -123,9 +123,9 @@ def remove_null_parms(**kwargs): return new -def list_hosts(nodes): - columns = ('uuid', 'name', 'type', 'status') - utils.print_list(nodes, columns, +def list_hosts(hosts): + columns = ('id', 'hostname', 'type', 'status') + utils.print_list(hosts, columns, {'versions': print_list_field('versions')}, sortby_index=None) diff --git a/gyanclient/v1/hosts_shell.py b/gyanclient/v1/hosts_shell.py index 766c4a3..e8f1194 100644 --- a/gyanclient/v1/hosts_shell.py +++ b/gyanclient/v1/hosts_shell.py @@ -28,15 +28,13 @@ def _show_host(host): utils.print_dict(host._info) -@utils.arg('host-id', +@utils.arg('host_id', metavar='', help='ID or name of the host to show.') def do_host_show(cs, args): """Show details of a Host.""" opts = {} - opts['host_id'] = args.host_id - opts = gyan_utils.remove_null_parms(**opts) - host = cs.hosts.get(**opts) + host = cs.hosts.get(args.host_id) _show_host(host)