diff --git a/glanceclient/tests/unit/v2/test_shell_v2.py b/glanceclient/tests/unit/v2/test_shell_v2.py index 33985b90..faaad01f 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 0b3b6da1..6143a74b 100644 --- a/glanceclient/v2/shell.py +++ b/glanceclient/v2/shell.py @@ -164,8 +164,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)