Make install command beta.

This commit is contained in:
Darko Poljak 2016-10-13 21:35:41 +02:00
commit 750f90db4c
2 changed files with 20 additions and 6 deletions

View file

@ -22,6 +22,8 @@
#
# list of beta sub-commands
BETA_COMMANDS = ['install', ]
# list of beta arguments for sub-commands
BETA_ARGS = {
'config': ['jobs', ],
@ -49,6 +51,10 @@ def check_beta(args_dict):
# raise error.
if not args_dict['beta']:
cmd = args_dict['command']
# first check if command is beta
if cmd in BETA_COMMANDS:
raise cdist.CdistBetaRequired(cmd)
# then check if command's argument is beta
if cmd in BETA_ARGS:
for arg in BETA_ARGS[cmd]:
if arg in args_dict and args_dict[arg]: