summaryrefslogtreecommitdiffstats
path: root/qtip/util/env.py
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-03-15 01:51:49 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-15 01:51:49 +0000
commit831fc9ca1e1c6b98d5359f3c3c3c8153c9213be8 (patch)
tree20037cb77e03eb9c5d1f346e4030f381e7d46850 /qtip/util/env.py
parent9fc7b928108e70e77dc2d9caf2b5b19a77251788 (diff)
parent7fab4cf1fa75d4251369e230f2792df0a16b4019 (diff)
Merge "add the cleanup step in runner.py" into stable/danube
Diffstat (limited to 'qtip/util/env.py')
-rw-r--r--qtip/util/env.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/qtip/util/env.py b/qtip/util/env.py
index 830c9b38..ffa56ae4 100644
--- a/qtip/util/env.py
+++ b/qtip/util/env.py
@@ -18,7 +18,7 @@ import paramiko
from qtip.util.logger import QtipLogger
-logger = QtipLogger('ansible_driver').get
+logger = QtipLogger('env').get
SCRIPT_DIR = path.join(path.dirname(__file__), path.pardir, 'scripts')
KEYNAME = 'QtipKey'
@@ -191,14 +191,18 @@ class AnsibleEnvSetup(object):
return False
def cleanup(self):
- IF_DEBUG = os.getenv('IF_DEBUG')
+ CI_DEBUG = os.getenv('CI_DEBUG')
- if IF_DEBUG:
+ if CI_DEBUG:
logger.info("DEBUG Mode: please do cleanup by manual.")
else:
- logger.info("Cleanup hostfile and keypair.")
- clean_file(self.hostfile, self.keypair, self.keypair + '.pub')
-
for ip in self.host_ip_list:
logger.info("Cleanup authorized_keys from {0}...".format(ip))
- os.system('bash %s/cleanup_creds.sh {0}'.format(ip))
+ cmd = 'bash {0}/cleanup_creds.sh {1} {2}'.format(
+ SCRIPT_DIR, ip, self.keypair['private'])
+ os.system(cmd)
+
+ logger.info("Cleanup hostfile and keypair.")
+ clean_file(self.hostfile,
+ self.keypair['private'],
+ self.keypair['public'])