Revision 4b129313 lib/rapi/client.py
b/lib/rapi/client.py | ||
---|---|---|
133 | 133 |
pass |
134 | 134 |
|
135 | 135 |
|
136 |
class CertificateError(Error): |
|
137 |
"""Raised when a problem is found with the SSL certificate. |
|
138 |
|
|
139 |
""" |
|
140 |
pass |
|
141 |
|
|
142 |
|
|
143 | 136 |
class GanetiApiError(Error): |
144 | 137 |
"""Generic error raised from Ganeti API. |
145 | 138 |
|
... | ... | |
149 | 142 |
self.code = code |
150 | 143 |
|
151 | 144 |
|
145 |
class CertificateError(GanetiApiError): |
|
146 |
"""Raised when a problem is found with the SSL certificate. |
|
147 |
|
|
148 |
""" |
|
149 |
pass |
|
150 |
|
|
151 |
|
|
152 | 152 |
def _AppendIf(container, condition, value): |
153 | 153 |
"""Appends to a list if a condition evaluates to truth. |
154 | 154 |
|
... | ... | |
470 | 470 |
curl.perform() |
471 | 471 |
except pycurl.error, err: |
472 | 472 |
if err.args[0] in _CURL_SSL_CERT_ERRORS: |
473 |
raise CertificateError("SSL certificate error %s" % err) |
|
473 |
raise CertificateError("SSL certificate error %s" % err, |
|
474 |
code=err.args[0]) |
|
474 | 475 |
|
475 | 476 |
raise GanetiApiError(str(err), code=err.args[0]) |
476 | 477 |
finally: |
Also available in: Unified diff