List commands should show a reduced set of columns
Change-Id: I8c56e5a9366e9e7b6569b7e001f069fc0a812470
This commit is contained in:
parent
41fde43dab
commit
48bcdae017
@ -95,9 +95,11 @@ class Command(CliffCommand):
|
|||||||
|
|
||||||
|
|
||||||
class ListCommand(Command, Lister):
|
class ListCommand(Command, Lister):
|
||||||
|
columns = None
|
||||||
|
|
||||||
def post_execute(self, results):
|
def post_execute(self, results):
|
||||||
if len(results) > 0:
|
if len(results) > 0:
|
||||||
columns = utils.get_columns(results)
|
columns = self.columns or utils.get_columns(results)
|
||||||
data = [utils.get_item_properties(i, columns) for i in results]
|
data = [utils.get_item_properties(i, columns) for i in results]
|
||||||
return columns, data
|
return columns, data
|
||||||
else:
|
else:
|
||||||
|
@ -23,6 +23,8 @@ LOG = logging.getLogger(__name__)
|
|||||||
class ListDomainsCommand(base.ListCommand):
|
class ListDomainsCommand(base.ListCommand):
|
||||||
""" List Domains """
|
""" List Domains """
|
||||||
|
|
||||||
|
columns = ['id', 'name', 'serial']
|
||||||
|
|
||||||
def execute(self, parsed_args):
|
def execute(self, parsed_args):
|
||||||
return self.client.domains.list()
|
return self.client.domains.list()
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ LOG = logging.getLogger(__name__)
|
|||||||
class ListRecordsCommand(base.ListCommand):
|
class ListRecordsCommand(base.ListCommand):
|
||||||
""" List Records """
|
""" List Records """
|
||||||
|
|
||||||
|
columns = ['id', 'name']
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
parser = super(ListRecordsCommand, self).get_parser(prog_name)
|
parser = super(ListRecordsCommand, self).get_parser(prog_name)
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ LOG = logging.getLogger(__name__)
|
|||||||
class ListServersCommand(base.ListCommand):
|
class ListServersCommand(base.ListCommand):
|
||||||
""" List Servers """
|
""" List Servers """
|
||||||
|
|
||||||
|
columns = ['id', 'name']
|
||||||
|
|
||||||
def execute(self, parsed_args):
|
def execute(self, parsed_args):
|
||||||
return self.client.servers.list()
|
return self.client.servers.list()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user