From: Markos Chandras <mchandras@suse.de>
Date: Tue, 19 Sep 2017 10:43:35 +0000 (+0100)
Subject: xci: xci-deploy.sh: Ensure env_reset is not present
X-Git-Tag: 6.0.0~303^2~1
X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=17d10d8b39a4475ea7faa0f59151f9edd278d9f0;p=releng-xci.git

xci: xci-deploy.sh: Ensure env_reset is not present

We are making use of 'sudo -E' to preserve environment variables
when using 'sudo' so we need to make sure that we don't use env_reset
in the configuration file.

Change-Id: I45a818da6c5c090ece67898e54f2dc4ba48cb452
Signed-off-by: Markos Chandras <mchandras@suse.de>
---

diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh
index 78194fbe..c985c7dd 100755
--- a/xci/xci-deploy.sh
+++ b/xci/xci-deploy.sh
@@ -114,6 +114,8 @@ fi
 #-------------------------------------------------------------------------------
 echo "Info: Starting provisining VM nodes using openstack/bifrost"
 echo "-------------------------------------------------------------------------"
+# We are using sudo so we need to make sure that env_reset is not present
+sudo sed -i "s/^Defaults.*env_reset/#&/" /etc/sudoers
 cd $XCI_PATH/../bifrost/
 sudo -E bash ./scripts/destroy-env.sh
 cd $XCI_PATH/playbooks