Skip to content

Commit e2dd825

Browse files
Mohammed AbuAishaearthmant
authored andcommitted
Update openstack client to handle merging openstack config between blueprint inputs and openstack env variables
1 parent 53230a6 commit e2dd825

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

CHANGELOG.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2.7.3:
2+
- Resolve issue with merging openstack config
13
2.7.2:
24
- Allow openstack_config keys to be empty, in case these values are taken from `openstack-config.json`.
35
- Fix bug where key type runtime properties were incorrectly assigned.

openstack_plugin_common/__init__.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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`.

plugin.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
plugins:
66
openstack:
77
executor: central_deployment_agent
8-
source: https://github.com/cloudify-cosmo/cloudify-openstack-plugin/archive/2.7.2.zip
8+
source: https://github.com/cloudify-cosmo/cloudify-openstack-plugin/archive/2.7.3.zip
99
package_name: cloudify-openstack-plugin
10-
package_version: '2.7.2'
10+
package_version: '2.7.3'
1111

1212
data_types:
1313
cloudify.openstack.types.custom_configuration:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
setup(
2020
zip_safe=True,
2121
name='cloudify-openstack-plugin',
22-
version='2.7.2',
22+
version='2.7.3',
2323
author='Cloudify',
2424
author_email='[email protected]',
2525
packages=[

0 commit comments

Comments
 (0)