@@ -613,14 +613,34 @@ class OpenStackClient(object):
613613 COMMON | {'project_id' , 'project_name' , 'user_domain_name' },
614614 COMMON | {'project_name' , 'user_domain_name' , 'project_domain_name' },
615615 ]
616+
617+ NON_AUTH_ITEMS = ['region' , 'insecure' ,
618+ 'ca_cert' , 'nova_url' ,
619+ 'neutron_url' , 'custom_configuration' , 'logging' ]
620+
616621 OPTIONAL_AUTH_PARAMS = {AUTH_PARAM_INSECURE , AUTH_PARM_CA_CERT }
617622
618623 def __init__ (self , client_name , client_class , config = None , * args , ** kw ):
619624 cfg = Config .get ()
620-
621625 if config :
622626 Config .update_config (cfg , config )
623627
628+ # This check to make sure that blueprint openstack config
629+ # contains all the required auth params + any non-auth param
630+ if set (config .keys ())\
631+ in self .AUTH_SETS and config .keys () in self .NON_AUTH_ITEMS :
632+
633+ # Check if there is any value exists on ``cfg``
634+ # that does not exist on ``config`` then these extra params
635+ # should be removed to prevent any merging conflicts
636+ removed_keys = []
637+ for k , v in cfg .iteritems ():
638+ if k not in config :
639+ removed_keys .append (k )
640+
641+ for key in removed_keys :
642+ del cfg [key ]
643+
624644 v3 = '/v3' in cfg ['auth_url' ]
625645 # Newer libraries expect the region key to be `region_name`, not
626646 # `region`.
0 commit comments