correct a mistake for os.getenv() 05/30505/2
authorwu.zhihui <wu.zhihui1@zte.com.cn>
Wed, 15 Mar 2017 05:00:25 +0000 (13:00 +0800)
committerzhihui wu <zhihui.wu2006+zte@gmail.com>
Thu, 16 Mar 2017 08:36:19 +0000 (08:36 +0000)
os.getenv returns a string not a boolean.
Although you set environment variable 'CI_DEBUG=false',
the cleanup will not be executed.

Change-Id: I077b602069f026a4b9ef6019869ac6c29c401c21
Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
qtip/util/env.py

index d00320c..ab9ffa7 100644 (file)
@@ -192,7 +192,7 @@ class AnsibleEnvSetup(object):
     def cleanup(self):
         CI_DEBUG = os.getenv('CI_DEBUG')
 
-        if CI_DEBUG:
+        if CI_DEBUG is not None and CI_DEBUG.lower() == 'true':
             logger.info("DEBUG Mode: please do cleanup by manual.")
         else:
             for ip in self.host_ip_list: