Commit 63f84e79 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

pubsub notifier: produce more explicit RSS

parent eab0d1fd
...@@ -37,18 +37,24 @@ def main(): ...@@ -37,18 +37,24 @@ def main():
stderr=subprocess.STDOUT stderr=subprocess.STDOUT
) )
exit_code = 0 exit_code = 0
content = ("OK</br><p>%s ran successfully</p>"
"<p>Output is: </p><pre>%s</pre>" % (
args.executable[0],
content.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
))
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
content = e.output content = e.output
exit_code = e.returncode exit_code = e.returncode
content = ("FAILURE</br><p>%s Failed with returncode <em>%d</em>.</p>"
print content
content += ("\n<p>Failed with returncode <em>%d</em>.</p>"
"<p>Output is: </p><pre>%s</pre>" % ( "<p>Output is: </p><pre>%s</pre>" % (
args.executable[0],
exit_code, exit_code,
content.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;') content.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
)) ))
print content
with open(args.logfile[0], 'a') as file_: with open(args.logfile[0], 'a') as file_:
cvsfile = csv.writer(file_) cvsfile = csv.writer(file_)
cvsfile.writerow([ cvsfile.writerow([
......
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