@@ -573,21 +573,11 @@ def __init__(self, client_name, client_class, config=None, *args, **kw):
573573 if v3 and region :
574574 cfg ['region_name' ] = region
575575
576- cfg = self ._merge_custom_configuration (cfg , client_name )
577-
578- auth_params , client_params = OpenStackClient ._split_config (cfg )
579- OpenStackClient ._validate_auth_params (auth_params )
580-
581- if v3 :
582- # keystone v3 complains if these aren't set.
583- for key in 'user_domain_name' , 'project_domain_name' :
584- auth_params .setdefault (key , 'default' )
585-
586576 # Calculate effective logging policy.
587577 # Note that we don't use dict's update() function at the dict's
588578 # root because it will overwrite nested dicts.
589579
590- logging_config = cfg .get ('logging' , dict ())
580+ logging_config = cfg .pop ('logging' , dict ())
591581 use_cfy_logger = logging_config .get (KEY_USE_CFY_LOGGER )
592582 groups_config = logging_config .get (KEY_GROUPS , {})
593583 loggers_config = logging_config .get (KEY_LOGGERS , {})
@@ -616,6 +606,16 @@ def __init__(self, client_name, client_class, config=None, *args, **kw):
616606 logger .addHandler (ctx_log_handler )
617607 logger .setLevel (logger_level )
618608
609+ cfg = self ._merge_custom_configuration (cfg , client_name )
610+
611+ auth_params , client_params = OpenStackClient ._split_config (cfg )
612+ OpenStackClient ._validate_auth_params (auth_params )
613+
614+ if v3 :
615+ # keystone v3 complains if these aren't set.
616+ for key in 'user_domain_name' , 'project_domain_name' :
617+ auth_params .setdefault (key , 'default' )
618+
619619 client_params ['session' ] = self ._authenticate (auth_params )
620620 self ._client = client_class (** client_params )
621621
0 commit comments