diff options
-rw-r--r-- | ipalib/errors.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py index 25f594f29..d85913042 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -231,8 +231,19 @@ class RegistrationError(IPAError): class NameSpaceError(RegistrationError): + """ + Raised when name is not a valid Python identifier for use for use as + the name of NameSpace member. + """ msg = 'name %r does not re.match %r' + def __init__(self, name, regex): + self.name = name + self.regex = regex + + def __str__(self): + return self.msg % (self.name, self.regex) + class SubclassError(RegistrationError): """ |