aboutsummaryrefslogtreecommitdiffstats
path: root/qtip/util
diff options
context:
space:
mode:
authorzhihui wu <zhihui.wu2006+zte@gmail.com>2017-03-15 01:09:48 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-15 01:09:48 +0000
commit383d1256a6eef703ce6c6003e2e0db8623ca0cac (patch)
treee11fef95a22483ff6ff78b4765025124ec68d644 /qtip/util
parent3391a3c6ab4f6b33e2f6d74e858a7bad573695b1 (diff)
parent57ec2e7a9757cbb1da8a1f73f0c55e8a5cb67bec (diff)
Merge "add the cleanup step in runner.py"
Diffstat (limited to 'qtip/util')
-rw-r--r--qtip/util/env.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/qtip/util/env.py b/qtip/util/env.py
index 6261f444..d00320c4 100644
--- a/qtip/util/env.py
+++ b/qtip/util/env.py
@@ -190,14 +190,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'])