From cca31b642f09c1ad66d54e09c9a7bce2b9704c7d Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Wed, 9 Jul 2014 23:31:16 +0200 Subject: [PATCH] Add documentation for the run() function. Also: Move the return statement in run() to the bottom --- bootstrapvz/base/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bootstrapvz/base/main.py b/bootstrapvz/base/main.py index 882ac5f..764cfbd 100644 --- a/bootstrapvz/base/main.py +++ b/bootstrapvz/base/main.py @@ -75,7 +75,10 @@ def setup_loggers(opts): def run(manifest, debug=False, pause_on_error=False, dry_run=False): """Runs the bootstrapping process - :params dict opts: Dictionary of options from the commandline + :params Manifest manifest: The manifest to run the bootstrapping process for + :params bool debug: Whether to turn debugging mode on + :params bool pause_on_error: Whether to pause on error, before rollback + :params bool dry_run: Don't actually run the tasks """ # Get the tasklist from tasklist import load_tasks @@ -93,7 +96,6 @@ def run(manifest, debug=False, pause_on_error=False, dry_run=False): tasklist.run(info=bootstrap_info, dry_run=dry_run) # We're done! :-) log.info('Successfully completed bootstrapping') - return bootstrap_info except (Exception, KeyboardInterrupt) as e: # When an error occurs, log it and begin rollback log.exception(e) @@ -124,3 +126,4 @@ def run(manifest, debug=False, pause_on_error=False, dry_run=False): rollback_tasklist.run(info=bootstrap_info, dry_run=dry_run) log.info('Successfully completed rollback') raise e + return bootstrap_info