Check for beta in scripts/cdist.

This commit is contained in:
Darko Poljak 2016-08-15 16:01:39 +02:00
commit fdf6a6570c
3 changed files with 36 additions and 18 deletions

View file

@ -56,6 +56,20 @@ class UnresolvableRequirementsError(cdist.Error):
pass
class CdistBetaRequired(cdist.Error):
"""Beta functionality is used but beta is not enabled"""
def __init__(self, command, arg):
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.")
return err_msg.format(self.arg, self.command)
class CdistObjectError(Error):
"""Something went wrong with an object"""