summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
101bff5)
This allows (in the future) for a nice summary after each run and allows
actions to fail without breaking out with an exception right away.
# Run it
action.run(test=opts.test)
action.finish(test=opts.test)
# Run it
action.run(test=opts.test)
action.finish(test=opts.test)
+ # Ask the action if there where any failures
+ success = not action.failed
- log.error('Running action "%s.%s" failed: %s', action_name, action_ty, e)
+ log.error('Unexpected exception: %s', e)
import traceback
log.debug(traceback.format_exc())
import traceback
log.debug(traceback.format_exc())
+ success = False
+
+ if success:
+ log.info('Running action "%s.%s" succeeded', action_name, action_ty)
+ else:
+ log.info('Running action "%s.%s" failed', action_name, action_ty)
# See backupninja.config.load_config for the structure of this
# value.
self.default_config = {}
# See backupninja.config.load_config for the structure of this
# value.
self.default_config = {}
+ # Assume we'll run succesfully. If anything fails in the
+ # meanwhile, set this to True.
+ self.failed = False
def run(self, **kwargs):
"""
def run(self, **kwargs):
"""