Merge "Add --marker option to "server list" command."

This commit is contained in:
Jenkins 2015-11-30 18:58:14 +00:00 committed by Gerrit Code Review
commit e63de0db2d
2 changed files with 22 additions and 1 deletions

View File

@ -187,6 +187,7 @@ List servers
[--all-projects]
[--project <project> [--project-domain <project-domain>]]
[--long]
[--marker <server>]
.. option:: --reservation-id <reservation-id>
@ -250,6 +251,11 @@ List servers
List additional fields in output
.. option:: --marker <server>
The last server (name or ID) of the previous page. Display list of servers
after marker. Display all servers if not specified.
server lock
-----------

View File

@ -747,6 +747,14 @@ class ListServer(lister.Lister):
default=False,
help=_('List additional fields in output'),
)
parser.add_argument(
'--marker',
metavar='<marker>',
default=None,
help=('The last server (name or ID) of the previous page. Display'
' list of servers after marker. Display all servers if not'
' specified.')
)
return parser
@utils.log_method(log)
@ -830,7 +838,14 @@ class ListServer(lister.Lister):
'Networks',
)
mixed_case_fields = []
data = compute_client.servers.list(search_opts=search_opts)
marker_id = None
if parsed_args.marker:
marker_id = utils.find_resource(compute_client.servers,
parsed_args.marker).id
data = compute_client.servers.list(search_opts=search_opts,
marker=marker_id)
return (column_headers,
(utils.get_item_properties(
s, columns,