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

@ -59,16 +59,24 @@ class UnresolvableRequirementsError(cdist.Error):
class CdistBetaRequired(cdist.Error):
"""Beta functionality is used but beta is not enabled"""
def __init__(self, command, arg):
def __init__(self, command, arg=None):
self.command = command
self.arg = arg
def __str__(self):
err_msg = ("\'{}\' argument of \'{}\' command is beta, but beta is "
"not enabled. If you want to use it please enable beta "
"functionalities by using the -b/--enable-beta command "
"line flag.")
return err_msg.format(self.arg, self.command)
if self.arg is None:
err_msg = ("\'{}\' command is beta, but beta is "
"not enabled. If you want to use it please enable beta "
"functionalities by using the -b/--enable-beta command "
"line flag.")
fmt_args = [self.command, ]
else:
err_msg = ("\'{}\' argument of \'{}\' command is beta, but beta "
"is not enabled. If you want to use it please enable "
"beta functionalities by using the -b/--enable-beta "
"command line flag.")
fmt_args = [self.arg, self.command, ]
return err_msg.format(*fmt_args)
class CdistObjectError(Error):