Fix host-list and host-show rendering issues

Change-Id: I248194b0fc1aaf776e50bb132b34bbbe0c1735bc
This commit is contained in:
bharath 2018-10-11 00:49:04 +05:30
parent bb6e3d02fd
commit 04c2e42647
2 changed files with 5 additions and 7 deletions

View File

@ -123,9 +123,9 @@ def remove_null_parms(**kwargs):
return new return new
def list_hosts(nodes): def list_hosts(hosts):
columns = ('uuid', 'name', 'type', 'status') columns = ('id', 'hostname', 'type', 'status')
utils.print_list(nodes, columns, utils.print_list(hosts, columns,
{'versions': print_list_field('versions')}, {'versions': print_list_field('versions')},
sortby_index=None) sortby_index=None)

View File

@ -28,15 +28,13 @@ def _show_host(host):
utils.print_dict(host._info) utils.print_dict(host._info)
@utils.arg('host-id', @utils.arg('host_id',
metavar='<host-id>', metavar='<host-id>',
help='ID or name of the host to show.') help='ID or name of the host to show.')
def do_host_show(cs, args): def do_host_show(cs, args):
"""Show details of a Host.""" """Show details of a Host."""
opts = {} opts = {}
opts['host_id'] = args.host_id host = cs.hosts.get(args.host_id)
opts = gyan_utils.remove_null_parms(**opts)
host = cs.hosts.get(**opts)
_show_host(host) _show_host(host)