From c6a9f766792032a4cc84bc801e15b05a29f09e8e Mon Sep 17 00:00:00 2001
From: Jonas Bjurel <jonas.bjurel@ericsson.com>
Date: Sat, 9 Jan 2016 16:01:50 +0100
Subject: Small fixes to the deployment scenario framework:

- Added deploy.sh -d option for dryrun. With -d + all the other mandatory
  arguments, deploy.sh produces ci/config/dea.yaml and /ci/config/dha.yaml
  with out actually deploying the stack.
- Bugfix to exit with rc <> 0 if deployment fails.
- Don't delete the programatically constructed dea.yaml or dha.yaml
  under fuel/ci/config after deploy has finished.
  dea.yaml and dha.yaml are needed functest, therefore these files
  must not be deleted after deployment has finished. They will reside
  in fuel/ci/config/.
- Dont merge the dha-override section in deployment scenarios with the final
  dha.yaml unless the deployment is virtual. There is no way you can
  programatically override physicall resources, wireing, ipmi set-up, etc. -
  while you can for virtual environments.

VERIFIED
READY TO MERGE

Change-Id: If4dedc472e07ed60071ee34c73db29f3b9c45252
Signed-off-by: Jonas Bjurel <jonas.bjurel@ericsson.com>
---
 deploy/deploy-config.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'deploy')

diff --git a/deploy/deploy-config.py b/deploy/deploy-config.py
index d9e774141..a0a44c1ed 100644
--- a/deploy/deploy-config.py
+++ b/deploy/deploy-config.py
@@ -264,7 +264,11 @@ dha_pod_conf.pop('dha-pod-config-metadata')
 final_dha_conf = dha_pod_conf
 
 dha_scenario_override_conf = deploy_scenario_conf["dha-override-config"]
-if dha_scenario_override_conf:
+# Only virtual deploy scenarios can override dha.yaml since there
+# is no way to programatically override a physical environment:
+# wireing, IPMI set-up, etc.
+# For Physical environments, dha.yaml overrides will be silently ignored
+if dha_scenario_override_conf and (final_dha_conf['adapter'] == 'libvirt' or final_dha_conf['adapter'] == 'esxi' or final_dha_conf['adapter'] == 'vbox'):
     print 'Merging dha-pod and deployment-scenario override information to final dha.yaml configuration....'
     final_dha_conf = dict(mergedicts(final_dha_conf, dha_scenario_override_conf))
 
-- 
cgit