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,9 +450,10 @@ 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,
traceback.format_exc()))
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':
try:
......@@ -469,9 +470,10 @@ 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,
traceback.format_exc()))
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'
# fallback should never get here
......
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