Remove null parms form image_list and host_list
Change-Id: I02af4573996f28d17dce78f90f3b5ede42bc90ca
This commit is contained in:
parent
165610ad9f
commit
a2daf8452e
@ -15,6 +15,8 @@ import logging
|
||||
from osc_lib.command import command
|
||||
from osc_lib import utils
|
||||
|
||||
from zunclient.common import utils as zun_utils
|
||||
|
||||
|
||||
def _host_columns(host):
|
||||
del host._info['links']
|
||||
@ -62,6 +64,7 @@ class ListHost(command.Lister):
|
||||
opts['limit'] = parsed_args.limit
|
||||
opts['sort_key'] = parsed_args.sort_key
|
||||
opts['sort_dir'] = parsed_args.sort_dir
|
||||
opts = zun_utils.remove_null_parms(**opts)
|
||||
hosts = client.hosts.list(**opts)
|
||||
columns = ('uuid', 'hostname', 'mem_total', 'cpus', 'os', 'labels')
|
||||
return (columns, (utils.get_item_properties(host, columns)
|
||||
|
@ -15,6 +15,8 @@ import logging
|
||||
from osc_lib.command import command
|
||||
from osc_lib import utils
|
||||
|
||||
from zunclient.common import utils as zun_utils
|
||||
|
||||
|
||||
def _image_columns(image):
|
||||
return image._info.keys()
|
||||
@ -61,6 +63,7 @@ class ListImage(command.Lister):
|
||||
opts['limit'] = parsed_args.limit
|
||||
opts['sort_key'] = parsed_args.sort_key
|
||||
opts['sort_dir'] = parsed_args.sort_dir
|
||||
opts = zun_utils.remove_null_parms(**opts)
|
||||
images = client.images.list(**opts)
|
||||
columns = ('uuid', 'image_id', 'repo', 'tag', 'size')
|
||||
return (columns, (utils.get_item_properties(image, columns)
|
||||
|
@ -40,6 +40,7 @@ def do_host_list(cs, args):
|
||||
opts['limit'] = args.limit
|
||||
opts['sort_key'] = args.sort_key
|
||||
opts['sort_dir'] = args.sort_dir
|
||||
opts = zun_utils.remove_null_parms(**opts)
|
||||
hosts = cs.hosts.list(**opts)
|
||||
columns = ('uuid', 'hostname', 'mem_total', 'cpus', 'os', 'labels')
|
||||
utils.print_list(hosts, columns,
|
||||
|
@ -51,6 +51,7 @@ def do_image_list(cs, args):
|
||||
opts['limit'] = args.limit
|
||||
opts['sort_key'] = args.sort_key
|
||||
opts['sort_dir'] = args.sort_dir
|
||||
opts = zun_utils.remove_null_parms(**opts)
|
||||
images = cs.images.list(**opts)
|
||||
columns = ('uuid', 'image_id', 'repo', 'tag', 'size')
|
||||
utils.print_list(images, columns,
|
||||
|
Loading…
Reference in New Issue
Block a user