diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-03-11 14:49:34 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-03-11 15:28:53 +1100 |
commit | 027123199e13cc02ae4edadd8f0dd0f0660e1193 (patch) | |
tree | c6c49eae8fb1bececb74992948ea3463918a1096 /source4/scripting/python/samba/provisionexceptions.py | |
parent | 59545276f2bd6df8ee5e75e96e707fd86ff44350 (diff) | |
download | samba-027123199e13cc02ae4edadd8f0dd0f0660e1193.tar.gz samba-027123199e13cc02ae4edadd8f0dd0f0660e1193.tar.xz samba-027123199e13cc02ae4edadd8f0dd0f0660e1193.zip |
s4:provision Improve the handling of provision errors
The backtraces were too confusing for our users, and didn't tell them
what to do to fix the problem. By printing the string (rather than a
backtrace), and including in the error what to do, and what file to
remove, we give them a chance.
Andrew Bartlett
Diffstat (limited to 'source4/scripting/python/samba/provisionexceptions.py')
-rw-r--r-- | source4/scripting/python/samba/provisionexceptions.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/provisionexceptions.py b/source4/scripting/python/samba/provisionexceptions.py index 604853fc198..6159a02e958 100644 --- a/source4/scripting/python/samba/provisionexceptions.py +++ b/source4/scripting/python/samba/provisionexceptions.py @@ -25,8 +25,12 @@ class ProvisioningError(Exception): """A generic provision error.""" + def __init__(self, value): + self.value = value + def __str__(self): + return "ProvisioningError: " + self.value -class InvalidNetbiosName(Exception): +class InvalidNetbiosName(ProvisioningError): """A specified name was not a valid NetBIOS name.""" def __init__(self, name): super(InvalidNetbiosName, self).__init__("The name '%r' is not a valid NetBIOS name" % name) |