s4:provision Improve the handling of provision errors
[Samba/kamenim.git] / source4 / scripting / python / samba / provisionexceptions.py
blob6159a02e9586b759cf296ddca5633ade43282da2
2 # Unix SMB/CIFS implementation.
3 # backend code for provisioning a Samba4 server
5 # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008
6 # Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008-2009
7 # Copyright (C) Oliver Liebel <oliver@itc.li> 2008-2009
9 # Based on the original in EJS:
10 # Copyright (C) Andrew Tridgell <tridge@samba.org> 2005
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 3 of the License, or
15 # (at your option) any later version.
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 class ProvisioningError(Exception):
27 """A generic provision error."""
28 def __init__(self, value):
29 self.value = value
30 def __str__(self):
31 return "ProvisioningError: " + self.value
33 class InvalidNetbiosName(ProvisioningError):
34 """A specified name was not a valid NetBIOS name."""
35 def __init__(self, name):
36 super(InvalidNetbiosName, self).__init__("The name '%r' is not a valid NetBIOS name" % name)