Skip to content

Commit

Permalink
Merge pull request #209 from cloudify-cosmo/206-resolve-issue-with-me…
Browse files Browse the repository at this point in the history
…rgin-openstack-config

Update openstack client to handle merging openstack config between bl…
  • Loading branch information
EarthmanT authored Apr 1, 2018
2 parents 85629d4 + fe5d2ae commit 6a9f088
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
2.7.1.1:
- Resolve issue with merging openstack config
2.7.1:
- Support identify floating ip network via relationship in floating ip.
- Improve list images in glance image type.
Expand Down
22 changes: 21 additions & 1 deletion openstack_plugin_common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,14 +619,34 @@ class OpenStackClient(object):
COMMON | {'project_id', 'project_name', 'user_domain_name'},
COMMON | {'project_name', 'user_domain_name', 'project_domain_name'},
]

NON_AUTH_ITEMS = ['region', 'insecure',
'ca_cert', 'nova_url',
'neutron_url', 'custom_configuration', 'logging']

OPTIONAL_AUTH_PARAMS = {AUTH_PARAM_INSECURE, AUTH_PARM_CA_CERT}

def __init__(self, client_name, client_class, config=None, *args, **kw):
cfg = Config.get()

if config:
Config.update_config(cfg, config)

# This check to make sure that blueprint openstack config
# contains all the required auth params + any non-auth param
if set(config.keys())\
in self.AUTH_SETS and config.keys() in self.NON_AUTH_ITEMS:

# Check if there is any value exists on ``cfg``
# that does not exist on ``config`` then these extra params
# should be removed to prevent any merging conflicts
removed_keys = []
for k, v in cfg.iteritems():
if k not in config:
removed_keys.append(k)

for key in removed_keys:
del cfg[key]

v3 = '/v3' in cfg['auth_url']
# Newer libraries expect the region key to be `region_name`, not
# `region`.
Expand Down
2 changes: 1 addition & 1 deletion plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins:
executor: central_deployment_agent
source: https://github.com/cloudify-cosmo/cloudify-openstack-plugin/archive/2.7.1.zip
package_name: cloudify-openstack-plugin
package_version: '2.7.1'
package_version: '2.7.1.1'

data_types:
cloudify.openstack.types.custom_configuration:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
setup(
zip_safe=True,
name='cloudify-openstack-plugin',
version='2.7.1',
version='2.7.1.1',
author='Cloudify',
author_email='[email protected]',
packages=[
Expand Down

0 comments on commit 6a9f088

Please sign in to comment.