Merge "Fix v2 so that you can see the default help info"
This commit is contained in:
commit
8eaefe90a9
glanceclient
@ -535,6 +535,7 @@ class OpenStackImagesShell(object):
|
|||||||
# Handle top-level --help/-h before attempting to parse
|
# Handle top-level --help/-h before attempting to parse
|
||||||
# a command off the command line
|
# a command off the command line
|
||||||
if options.help or not argv:
|
if options.help or not argv:
|
||||||
|
parser = _get_subparser(api_version)
|
||||||
self.do_help(options, parser=parser)
|
self.do_help(options, parser=parser)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@ -538,9 +538,14 @@ class ShellTest(testutils.TestCase):
|
|||||||
except SystemExit:
|
except SystemExit:
|
||||||
self.fail('Unexpected SystemExit')
|
self.fail('Unexpected SystemExit')
|
||||||
|
|
||||||
# We expect the normal usage as a result
|
# We expect the normal v2 usage as a result
|
||||||
self.assertIn('Command-line interface to the OpenStack Images API',
|
expected = ['Command-line interface to the OpenStack Images API',
|
||||||
sys.stdout.getvalue())
|
'image-list',
|
||||||
|
'image-deactivate',
|
||||||
|
'location-add']
|
||||||
|
for output in expected:
|
||||||
|
self.assertIn(output,
|
||||||
|
sys.stdout.getvalue())
|
||||||
|
|
||||||
@mock.patch('glanceclient.v2.client.Client')
|
@mock.patch('glanceclient.v2.client.Client')
|
||||||
@mock.patch('glanceclient.v1.shell.do_image_list')
|
@mock.patch('glanceclient.v1.shell.do_image_list')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user