File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,7 +86,15 @@ def take_action(self, parsed_args):
8686 # Handle xxxclient and openstacksdk
8787 (k .endswith ('client' ) or k == 'openstack' )):
8888 try :
89- data [k ] = mods [k ].__version__
89+ # NOTE(RuiChen): openstacksdk bug/1588823 exist,
90+ # no good way to add __version__ for
91+ # openstack module properly, hard code
92+ # looks bad, but openstacksdk module
93+ # information is important.
94+ if k == 'openstack' :
95+ data [k ] = mods [k ].version .__version__
96+ else :
97+ data [k ] = mods [k ].__version__
9098 except Exception :
9199 # Catch all exceptions, just skip it
92100 pass
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ class ModuleTest(base.TestCase):
2323
2424 CLIENTS = ['openstackclient' ,
2525 'keystoneclient' ,
26- 'novaclient' ]
26+ 'novaclient' ,
27+ 'openstack' ]
2728
2829 LIBS = ['osc_lib' ,
2930 'os_client_config' ,
Original file line number Diff line number Diff line change @@ -161,6 +161,9 @@ class FakeModule(object):
161161 def __init__ (self , name , version ):
162162 self .name = name
163163 self .__version__ = version
164+ # Workaround for openstacksdk case
165+ self .version = mock .Mock ()
166+ self .version .__version__ = version
164167
165168
166169class FakeResource (object ):
You can’t perform that action at this time.
0 commit comments