Merge "Add new option to the 'list' shell command"

This commit is contained in:
Jenkins 2014-07-31 21:42:10 +00:00 committed by Gerrit Code Review
commit ec10415dc4
2 changed files with 10 additions and 0 deletions

View File

@ -506,6 +506,11 @@ def do_access_list(cs, args):
metavar='<status>',
default=None,
help='Filter results by status')
@utils.arg(
'--share-server-id',
metavar='<share_server_id>',
default=None,
help='Filter results by share-server id.')
@utils.service_type('share')
def do_list(cs, args):
"""List all NAS shares."""
@ -514,6 +519,7 @@ def do_list(cs, args):
'all_tenants': all_tenants,
'name': args.name,
'status': args.status,
'share_server_id': args.share_server_id,
}
shares = cs.shares.list(search_opts=search_opts)
utils.print_list(shares,

View File

@ -90,6 +90,10 @@ class ShellTest(utils.TestCase):
self.run_command('list --all-tenants=1')
self.assert_called('GET', '/shares/detail?all_tenants=1')
def test_list_filter_share_server_id(self):
self.run_command('list --share-server-id=1234')
self.assert_called('GET', '/shares/detail?share_server_id=1234')
def test_show(self):
self.run_command('show 1234')
self.assert_called('GET', '/shares/1234')