git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PL importer: do not import external sites, persons and slices into the registry
[sfa.git]
/
sfa
/
util
/
faults.py
diff --git
a/sfa/util/faults.py
b/sfa/util/faults.py
index
e46b986
..
f1d5cfd
100644
(file)
--- a/
sfa/util/faults.py
+++ b/
sfa/util/faults.py
@@
-35,9
+35,15
@@
class SfaFault(xmlrpclib.Fault):
class Forbidden(SfaFault):
def __init__(self, extra = None):
class Forbidden(SfaFault):
def __init__(self, extra = None):
- faultString = "FORBIDDEN
:
"
+ faultString = "FORBIDDEN"
SfaFault.__init__(self, GENICODE.FORBIDDEN, faultString, extra)
SfaFault.__init__(self, GENICODE.FORBIDDEN, faultString, extra)
+class BadArgs(SfaFault):
+ def __init__(self, extra = None):
+ faultString = "BADARGS"
+ SfaFault.__init__(self, GENICODE.BADARGS, faultString, extra)
+
+
class CredentialMismatch(SfaFault):
def __init__(self, extra = None):
faultString = "Credential mismatch"
class CredentialMismatch(SfaFault):
def __init__(self, extra = None):
faultString = "Credential mismatch"
@@
-323,7
+329,7
@@
class InvalidXML(SfaFault):
def __init__(self, value, extra = None):
self.value = value
faultString = "Invalid XML Document: %(value)s" % locals()
def __init__(self, value, extra = None):
self.value = value
faultString = "Invalid XML Document: %(value)s" % locals()
- SfaFault.__init__(self, GENICODE.
ERROR
, faultString, extra)
+ SfaFault.__init__(self, GENICODE.
BADARGS
, faultString, extra)
def __str__(self):
return repr(self.value)
def __str__(self):
return repr(self.value)
@@
-335,10
+341,13
@@
class AccountNotEnabled(SfaFault):
return repr(self.value)
class CredentialNotVerifiable(SfaFault):
return repr(self.value)
class CredentialNotVerifiable(SfaFault):
- def __init__(self, value, extra = None):
+ def __init__(self, value
=None
, extra = None):
self.value = value
self.value = value
- faultString = "Unable to verify credential: %(value)s, " %locals()
- SfaFault.__init__(self, GENICODE.ERROR, faultString, extra)
+ faultString = "Unable to verify credential" %locals()
+ if value:
+ faultString += ": %s" % value
+ faultString += ", "
+ SfaFault.__init__(self, GENICODE.BADARGS, faultString, extra)
def __str__(self):
return repr(self.value)
def __str__(self):
return repr(self.value)