---
lib/rapi/client.py | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/lib/rapi/client.py b/lib/rapi/client.py
index d68bb62..15e61f4 100644
--- a/lib/rapi/client.py
+++ b/lib/rapi/client.py
@@ -133,13 +133,6 @@ class Error(Exception):
pass
-class CertificateError(Error):
- """Raised when a problem is found with the SSL certificate.
-
- """
- pass
-
-
class GanetiApiError(Error):
"""Generic error raised from Ganeti API.
@@ -149,6 +142,13 @@ class GanetiApiError(Error):
self.code = code
+class CertificateError(GanetiApiError):
+ """Raised when a problem is found with the SSL certificate.
+
+ """
+ pass
+
+
def _AppendIf(container, condition, value):
"""Appends to a list if a condition evaluates to truth.
@@ -470,7 +470,8 @@ class GanetiRapiClient(object): # pylint: disable=R0904
curl.perform()
except pycurl.error, err:
if err.args[0] in _CURL_SSL_CERT_ERRORS:
- raise CertificateError("SSL certificate error %s" % err)
+ raise CertificateError("SSL certificate error %s" % err,
+ code=err.args[0])
raise GanetiApiError(str(err), code=err.args[0])
finally:
--
1.7.7.3