Skip to content

Commit

Permalink
Added an --profile option to override the config
Browse files Browse the repository at this point in the history
Signed-off-by: Camille Moncelier <camille@moncelier.fr>
  • Loading branch information
pix committed Sep 7, 2017
1 parent 55abc1e commit f524ace
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions malboxes/malboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit f524ace

Please sign in to comment.