Commit 2d7be8cf authored by Alain Takoudjou's avatar Alain Takoudjou

notifier: do not fail if feed files was rotated

/reviewed-on nexedi/slapos.toolbox!32
parent 9d6485ab
...@@ -116,7 +116,8 @@ def main(): ...@@ -116,7 +116,8 @@ def main():
try: try:
shutil.copy2(args.logfile[0], temp_file) shutil.copy2(args.logfile[0], temp_file)
except IOError: except IOError:
error_message = "ERROR ON WRITING FEED" # previous feed can be rotated, only pass
pass
try: try:
with open(temp_file, 'a') as file_: with open(temp_file, 'a') as file_:
csvfile = csv.writer(file_) csvfile = csv.writer(file_)
...@@ -127,8 +128,8 @@ def main(): ...@@ -127,8 +128,8 @@ def main():
'slapos:%s' % uuid.uuid4(), 'slapos:%s' % uuid.uuid4(),
]) ])
os.rename(temp_file, args.logfile[0]) os.rename(temp_file, args.logfile[0])
except: except Exception, e:
error_message = "ERROR ON WRITING FEED" error_message = "ERROR ON WRITING FEED - %s" % str(e)
finally: finally:
try: try:
os.remove(temp_file) os.remove(temp_file)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment