Commit 55608031 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(configd) align exception handling

(cherry picked from commit 8f92a6a2)
parent a6ca7de3
......@@ -450,8 +450,9 @@ class Action(object):
else:
syslog.syslog(syslog.LOG_ERR, '[%s] returned exit status %d' % (message_uuid, exit_status))
return 'Error (%d)' % exit_status
except:
syslog.syslog(syslog.LOG_ERR, '[%s] Script action failed at %s' % (message_uuid,
except Exception as script_exception:
syslog.syslog(syslog.LOG_ERR, '[%s] Script action failed with %s at %s' % (message_uuid,
script_exception,
traceback.format_exc()))
return 'Execute error'
elif self.type.lower() == 'script_output':
......@@ -469,8 +470,9 @@ class Action(object):
script_error_output.strip()[:255])
)
return script_output
except:
syslog.syslog(syslog.LOG_ERR, '[%s] Script action failed at %s' % (message_uuid,
except Exception as script_exception:
syslog.syslog(syslog.LOG_ERR, '[%s] Script action failed with %s at %s' % (message_uuid,
script_exception,
traceback.format_exc()))
return 'Execute error'
......
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