handler.setFormatter(formatter)
logging.getLogger().addHandler(handler)
- with file(os.path.join(ctx.archive, 'config.yaml'), 'w') as f:
- yaml.safe_dump(ctx.config, f, default_flow_style=False)
-
log.debug('\n '.join(['Config:', ] + yaml.safe_dump(ctx.config, default_flow_style=False).splitlines()))
ctx.summary = dict(success=True)
init_tasks.append({'internal.lock_machines': len(ctx.config['roles'])})
init_tasks.extend([
+ {'internal.save_config': None},
{'internal.check_lock': None},
{'internal.connect': None},
{'internal.check_conflict': None},
for machine in ctx.config['targets'].iterkeys():
lock.unlock(ctx, machine, ctx.owner)
+def save_config(ctx, config):
+ log.info('Saving configuration')
+ if ctx.archive is not None:
+ with file(os.path.join(ctx.archive, 'config.yaml'), 'w') as f:
+ yaml.safe_dump(ctx.config, f, default_flow_style=False)
+
def check_lock(ctx, config):
log.info('Checking locks...')
for machine in ctx.config['targets'].iterkeys():