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)