@@ -234,6 +234,23 @@ def initialize_app(self, argv):
234234 cloud_config .set_default ('auth_type' , 'osc_password' )
235235 self .log .debug ("options: %s" , self .options )
236236
237+ project_id = getattr (self .options , 'project_id' , None )
238+ project_name = getattr (self .options , 'project_name' , None )
239+ tenant_id = getattr (self .options , 'tenant_id' , None )
240+ tenant_name = getattr (self .options , 'tenant_name' , None )
241+
242+ # handle some v2/v3 authentication inconsistencies by just acting like
243+ # both the project and tenant information are both present. This can
244+ # go away if we stop registering all the argparse options together.
245+ if project_id and not tenant_id :
246+ self .options .tenant_id = project_id
247+ if project_name and not tenant_name :
248+ self .options .tenant_name = project_name
249+ if tenant_id and not project_id :
250+ self .options .project_id = tenant_id
251+ if tenant_name and not project_name :
252+ self .options .project_name = tenant_name
253+
237254 # Do configuration file handling
238255 cc = cloud_config .OpenStackConfig ()
239256 self .log .debug ("defaults: %s" , cc .defaults )
0 commit comments