summaryrefslogtreecommitdiffstats
path: root/deploy/cloud/configure_settings.py
diff options
context:
space:
mode:
authorJonas Bjurel <jonas.bjurel@ericsson.com>2016-01-28 19:34:29 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-01-28 19:34:29 +0000
commitc2445cb3b61e28027c69c234479212852cff5bc7 (patch)
treef1dfa761342813708746f207ee7576d78232b170 /deploy/cloud/configure_settings.py
parentbf6f1ba5b6e91cf73e74b4fe50063f88d74f18b3 (diff)
parente47ffb12088f4e2a2e679c4343602c09f9ff1525 (diff)
Merge "Support new plugin configuration schema"
Diffstat (limited to 'deploy/cloud/configure_settings.py')
-rw-r--r--deploy/cloud/configure_settings.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/deploy/cloud/configure_settings.py b/deploy/cloud/configure_settings.py
index 052634f99..b60a60fd1 100644
--- a/deploy/cloud/configure_settings.py
+++ b/deploy/cloud/configure_settings.py
@@ -54,12 +54,22 @@ class ConfigureSettings(object):
backup(settings_yaml)
settings = self.dea.get_property('settings')
# Copy fuel defined plugin_id's to user defined settings
+ # From Fuel 8.0 chosen_id was added because it is now
+ # possible to install many version of the same plugin
+ # but we will install only one version
for plugin in orig_dea['editable']:
- if 'metadata' in orig_dea['editable'][plugin] and 'plugin_id' in orig_dea['editable'][plugin]['metadata']:
- if not plugin in settings['editable']:
- settings['editable'][plugin] = orig_dea['editable'][plugin]
- else:
- settings['editable'][plugin]["metadata"]["plugin_id"] = orig_dea['editable'][plugin]["metadata"]["plugin_id"]
+ if 'metadata' in orig_dea['editable'][plugin]:
+ if 'plugin_id' in orig_dea['editable'][plugin]['metadata']:
+ if not plugin in settings['editable']:
+ settings['editable'][plugin] = orig_dea['editable'][plugin]
+ else:
+ settings['editable'][plugin]["metadata"]["plugin_id"] = orig_dea['editable'][plugin]["metadata"]["plugin_id"]
+ elif 'chosen_id' in orig_dea['editable'][plugin]['metadata']:
+ if not plugin in settings['editable']:
+ settings['editable'][plugin] = orig_dea['editable'][plugin]
+ else:
+ settings['editable'][plugin]['metadata']['chosen_id'] = orig_dea['editable'][plugin]['metadata']['chosen_id']
+ settings['editable'][plugin]['metadata']['versions'][0]['metadata']['plugin_id'] = orig_dea['editable'][plugin]['metadata']['versions'][0]['metadata']['plugin_id']
with io.open(settings_yaml, 'w') as stream:
yaml.dump(settings, stream, default_flow_style=False)