From f524ace0e25daba3508296bbb8e66be04cd26f6b Mon Sep 17 00:00:00 2001 From: Camille Moncelier Date: Wed, 6 Sep 2017 20:49:22 +0200 Subject: [PATCH] Added an --profile option to override the config Signed-off-by: Camille Moncelier --- malboxes/malboxes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/malboxes/malboxes.py b/malboxes/malboxes.py index 8f147b2..e6736fd 100644 --- a/malboxes/malboxes.py +++ b/malboxes/malboxes.py @@ -94,6 +94,8 @@ def init_parser(): parser_build.add_argument('--force', action='store_true', help='Force the build to happen. Overwrites ' 'pre-existing builds or vagrant boxes.') + parser_build.add_argument('--profile', dest='profile', action='store', + help='Override the profile setting') parser_build.add_argument('--show-packer-template', action='store_true', help='Print the packer template and exit. ' 'Only useful for debugging.') @@ -213,6 +215,10 @@ def prepare_config(args): config = load_config(config_file, template) + if getattr(args, 'profile', None): + print("Profile set to: {}".format(args.profile)) + config["profile"] = args.profile + if "profile" in config.keys(): profile_config = prepare_profile(template, config)