Skip to content

Commit 5b73612

Browse files
authored
Merge pull request #191 from cloudify-cosmo/add-type-defs
Add type defs
2 parents a49141f + 4d2778a commit 5b73612

File tree

4 files changed

+200
-16
lines changed

4 files changed

+200
-16
lines changed

CHANGELOG.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
2.5.3:
1+
2.6.0:
22
- Added ability to configure how log records, emitted by the underlying OpenStack client libraries,
33
are handled. By default, these are now also emitted to Cloudify's context logger (in debug level).
4+
- Added validation for the openstack_config sections.
45
2.5.2:
56
- Added ability to provide CA cert for connecting to OpenStack.
67
2.5.1:

openstack_plugin_common/__init__.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)