summaryrefslogtreecommitdiffstats
path: root/fuel/deploy/common.py
diff options
context:
space:
mode:
authorSzilard Cserey <szilard.cserey@ericsson.com>2015-10-29 10:22:18 +0100
committerSzilard Cserey <szilard.cserey@ericsson.com>2015-11-05 14:43:08 +0100
commit0bf6a9dbf59f95557263ae5cafea0b2a9dcf176d (patch)
tree6c66d99bca9a8054a0b88b640d909226f69bc456 /fuel/deploy/common.py
parent2e79518efec3286008deadcd6709e74d4cac11ea (diff)
minor fixes
fix for error log collecting feature Change-Id: I4db2ac19421301e1745a3beed90f32df57d75f8d Signed-off-by: Szilard Cserey <szilard.cserey@ericsson.com>
Diffstat (limited to 'fuel/deploy/common.py')
-rw-r--r--fuel/deploy/common.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/fuel/deploy/common.py b/fuel/deploy/common.py
index cdc54b43a..17fd2174a 100644
--- a/fuel/deploy/common.py
+++ b/fuel/deploy/common.py
@@ -30,10 +30,13 @@ formatter = logging.Formatter('%(message)s')
out_handler = logging.StreamHandler(sys.stdout)
out_handler.setFormatter(formatter)
LOG.addHandler(out_handler)
-out_handler = logging.FileHandler('autodeploy.log', mode='w')
+LOGFILE = 'autodeploy.log'
+if os.path.isfile(LOGFILE):
+ os.remove(LOGFILE)
+out_handler = logging.FileHandler(LOGFILE, mode='w')
out_handler.setFormatter(formatter)
LOG.addHandler(out_handler)
-os.chmod('autodeploy.log', stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
+os.chmod(LOGFILE, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
def exec_cmd(cmd, check=True):
process = subprocess.Popen(cmd,