opts are the parsed commandline options, global_config is the parsed
global configuration.
"""
+ log.info('Running all actions')
try:
actions = config.list_actions(opts)
except OSError, e:
Run a single action. opts are the parsed commandline options,
global_config is the parsed global configuration.
"""
+ log.info('Running action "%s"', action)
# Split the action filename
parts = action.split('.', 2)
if (len(parts) < 2):
modname = 'backupninja.handlers.%s' % ty
# Load the handler if it is not loaded yet
if not modname in sys.modules:
+ log.debug('Loading handler for type "%s"', ty)
try:
__import__(modname, globals(), locals(), [])
except ImportError, e:
# Add some extra info, since the default exception does not
# show the full module name.
raise ImportError('Cannot load module %s: %s' % (modname, e))
+ log.debug('Loaded handler for type "%s" from "%s"', ty, sys.modules[modname].__file__)
# Get the module from the module table
module = sys.modules[modname]