Show openstacksdk version info in "module list"
openstacksdk bug/1588823 exist, no good way to add __version__ for openstack module properly, fix the issue in osc side, make openstacksdk module information be available. Change-Id: I27ff61792443d1aa07f31598bed3aa32f924ff40 Partial-Bug: #1662058
This commit is contained in:
parent
62938c02e0
commit
10f0300f70
@ -86,7 +86,15 @@ class ListModule(command.ShowOne):
|
|||||||
# Handle xxxclient and openstacksdk
|
# Handle xxxclient and openstacksdk
|
||||||
(k.endswith('client') or k == 'openstack')):
|
(k.endswith('client') or k == 'openstack')):
|
||||||
try:
|
try:
|
||||||
data[k] = mods[k].__version__
|
# NOTE(RuiChen): openstacksdk bug/1588823 exist,
|
||||||
|
# no good way to add __version__ for
|
||||||
|
# openstack module properly, hard code
|
||||||
|
# looks bad, but openstacksdk module
|
||||||
|
# information is important.
|
||||||
|
if k == 'openstack':
|
||||||
|
data[k] = mods[k].version.__version__
|
||||||
|
else:
|
||||||
|
data[k] = mods[k].__version__
|
||||||
except Exception:
|
except Exception:
|
||||||
# Catch all exceptions, just skip it
|
# Catch all exceptions, just skip it
|
||||||
pass
|
pass
|
||||||
|
@ -23,7 +23,8 @@ class ModuleTest(base.TestCase):
|
|||||||
|
|
||||||
CLIENTS = ['openstackclient',
|
CLIENTS = ['openstackclient',
|
||||||
'keystoneclient',
|
'keystoneclient',
|
||||||
'novaclient']
|
'novaclient',
|
||||||
|
'openstack']
|
||||||
|
|
||||||
LIBS = ['osc_lib',
|
LIBS = ['osc_lib',
|
||||||
'os_client_config',
|
'os_client_config',
|
||||||
|
@ -161,6 +161,9 @@ class FakeModule(object):
|
|||||||
def __init__(self, name, version):
|
def __init__(self, name, version):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.__version__ = version
|
self.__version__ = version
|
||||||
|
# Workaround for openstacksdk case
|
||||||
|
self.version = mock.Mock()
|
||||||
|
self.version.__version__ = version
|
||||||
|
|
||||||
|
|
||||||
class FakeResource(object):
|
class FakeResource(object):
|
||||||
|
Loading…
Reference in New Issue
Block a user