Skip to content
Snippets Groups Projects
Commit 0715c062 authored by Chris Hines's avatar Chris Hines
Browse files

blargal

parent 6247e73b
No related branches found
No related tags found
3 merge requests!77Revert "disable agressive kill and restart",!64Test,!62Dev
Pipeline #15810 passed
...@@ -187,7 +187,7 @@ class ContactUs(Resource): ...@@ -187,7 +187,7 @@ class ContactUs(Resource):
f.close() f.close()
return return
def wrap_execute(sshsess, host, bastion=None, user=None, cmd=None): def wrap_execute(sess, host, user, cmd, bastion=None,stdin=None, sshport="22", bastionsshport="22"):
""" """
This function is supposed to interpret all the possible exceptions from Ssh.execute and generate This function is supposed to interpret all the possible exceptions from Ssh.execute and generate
approrparite HTTP errors (both status codes and messages) approrparite HTTP errors (both status codes and messages)
...@@ -199,10 +199,7 @@ def wrap_execute(sshsess, host, bastion=None, user=None, cmd=None): ...@@ -199,10 +199,7 @@ def wrap_execute(sshsess, host, bastion=None, user=None, cmd=None):
the data on stderr might be valid json or not. the data on stderr might be valid json or not.
""" """
try: try:
if bastion is None: res = Ssh.execute(sess, host, user, cmd, bastion, stdin, sshport, bastionsshport)
res = Ssh.execute(sshsess, host=host, user=user, cmd=cmd)
else:
res = Ssh.execute(sshsess, host=host, bastion=bastion, user=user, cmd=cmd)
if not (res['stderr'] == '' or res['stderr'] is None or res['stderr'] == b''): if not (res['stderr'] == '' or res['stderr'] is None or res['stderr'] == b''):
logger.error(res['stderr']) logger.error(res['stderr'])
#flask_restful.abort(400, message=res['stderr'].decode()) #flask_restful.abort(400, message=res['stderr'].decode())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment