diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-05-25 21:15:12 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-05-25 21:15:12 +0000 |
commit | 2eb5292e9de4ba212a204c187458fef93e2f2e33 (patch) | |
tree | b740d0c9585eabfed85ed1722490303327e1abfa | |
parent | 0c244b24bd70c8ae54b0ed5e6096043f780a0eab (diff) | |
parent | 6cb26fc2bf73759d0b88b12288d93797b2618448 (diff) | |
download | python-glanceclient-2eb5292e9de4ba212a204c187458fef93e2f2e33.tar.gz |
Merge "Include owner and status option in v2 image list"
-rw-r--r-- | glanceclient/tests/unit/v2/test_shell_v2.py | 12 | ||||
-rw-r--r-- | glanceclient/v2/shell.py | 6 |
2 files changed, 13 insertions, 5 deletions
diff --git a/glanceclient/tests/unit/v2/test_shell_v2.py b/glanceclient/tests/unit/v2/test_shell_v2.py index 33985b9..faaad01 100644 --- a/glanceclient/tests/unit/v2/test_shell_v2.py +++ b/glanceclient/tests/unit/v2/test_shell_v2.py @@ -71,7 +71,8 @@ class ShellV2Test(testtools.TestCase): 'properties': [], 'sort_key': ['name', 'id'], 'sort_dir': ['desc', 'asc'], - 'sort': None + 'sort': None, + 'verbose': False } args = self._make_args(input) with mock.patch.object(self.gc.images, 'list') as mocked_list: @@ -104,7 +105,8 @@ class ShellV2Test(testtools.TestCase): 'properties': [], 'sort_key': ['name'], 'sort_dir': ['desc'], - 'sort': None + 'sort': None, + 'verbose': False } args = self._make_args(input) with mock.patch.object(self.gc.images, 'list') as mocked_list: @@ -137,7 +139,8 @@ class ShellV2Test(testtools.TestCase): 'properties': [], 'sort': 'name:desc,size:asc', 'sort_key': [], - 'sort_dir': [] + 'sort_dir': [], + 'verbose': False } args = self._make_args(input) with mock.patch.object(self.gc.images, 'list') as mocked_list: @@ -170,7 +173,8 @@ class ShellV2Test(testtools.TestCase): 'properties': ['os_distro=NixOS', 'architecture=x86_64'], 'sort_key': ['name'], 'sort_dir': ['desc'], - 'sort': None + 'sort': None, + 'verbose': False } args = self._make_args(input) with mock.patch.object(self.gc.images, 'list') as mocked_list: diff --git a/glanceclient/v2/shell.py b/glanceclient/v2/shell.py index 7298069..1ee16f3 100644 --- a/glanceclient/v2/shell.py +++ b/glanceclient/v2/shell.py @@ -166,8 +166,12 @@ def do_image_list(gc, args): elif not args.sort_dir and not args.sort_key: kwargs['sort'] = 'name:asc' - images = gc.images.list(**kwargs) columns = ['ID', 'Name'] + + if args.verbose: + columns += ['owner', 'status'] + + images = gc.images.list(**kwargs) utils.print_list(images, columns) |