move zfssa exception
This patch moves the zfssa exception to the zfssa webdavclient Change-Id: Idbd9f2f5befcf89e34f668a6620e7fe3e05a35da
This commit is contained in:
parent
0bc7bd7435
commit
a203f363d9
|
@ -1173,13 +1173,6 @@ class ZadaraVolumeNotFound(VolumeDriverException):
|
||||||
message = "%(reason)s"
|
message = "%(reason)s"
|
||||||
|
|
||||||
|
|
||||||
# ZFSSA NFS driver exception.
|
|
||||||
class WebDAVClientError(VolumeDriverException):
|
|
||||||
message = _("The WebDAV request failed. Reason: %(msg)s, "
|
|
||||||
"Return code/reason: %(code)s, Source Volume: %(src)s, "
|
|
||||||
"Destination Volume: %(dst)s, Method: %(method)s.")
|
|
||||||
|
|
||||||
|
|
||||||
# StorPool driver
|
# StorPool driver
|
||||||
class StorPoolConfigurationInvalid(CinderException):
|
class StorPoolConfigurationInvalid(CinderException):
|
||||||
message = _("Invalid parameter %(param)s in the %(section)s section "
|
message = _("Invalid parameter %(param)s in the %(section)s section "
|
||||||
|
|
|
@ -59,6 +59,12 @@ propertyupdate_data = """<?xml version="1.0"?>
|
||||||
</D:propertyupdate>"""
|
</D:propertyupdate>"""
|
||||||
|
|
||||||
|
|
||||||
|
class WebDAVClientError(exception.VolumeDriverException):
|
||||||
|
message = _("The WebDAV request failed. Reason: %(msg)s, "
|
||||||
|
"Return code/reason: %(code)s, Source Volume: %(src)s, "
|
||||||
|
"Destination Volume: %(dst)s, Method: %(method)s.")
|
||||||
|
|
||||||
|
|
||||||
class ZFSSAWebDAVClient(object):
|
class ZFSSAWebDAVClient(object):
|
||||||
def __init__(self, url, auth_str, **kwargs):
|
def __init__(self, url, auth_str, **kwargs):
|
||||||
"""Initialize WebDAV Client"""
|
"""Initialize WebDAV Client"""
|
||||||
|
@ -129,15 +135,14 @@ class ZFSSAWebDAVClient(object):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
msg = self._lookup_error(err.code)
|
msg = self._lookup_error(err.code)
|
||||||
raise exception.WebDAVClientError(msg=msg, code=err.code,
|
raise WebDAVClientError(msg=msg, code=err.code,
|
||||||
src=src_file, dst=dst_file,
|
src=src_file, dst=dst_file,
|
||||||
method=method)
|
method=method)
|
||||||
|
|
||||||
except http_client.BadStatusLine as err:
|
except http_client.BadStatusLine as err:
|
||||||
msg = self._lookup_error('BadStatusLine')
|
msg = self._lookup_error('BadStatusLine')
|
||||||
code = 'http_client.BadStatusLine'
|
code = 'http_client.BadStatusLine'
|
||||||
raise exception.WebDAVClientError(msg=msg,
|
raise WebDAVClientError(msg=msg, code=code,
|
||||||
code=code,
|
|
||||||
src=src_file, dst=dst_file,
|
src=src_file, dst=dst_file,
|
||||||
method=method)
|
method=method)
|
||||||
|
|
||||||
|
@ -147,8 +152,8 @@ class ZFSSAWebDAVClient(object):
|
||||||
reason = err.reason
|
reason = err.reason
|
||||||
|
|
||||||
msg = self._lookup_error('Bad_Gateway')
|
msg = self._lookup_error('Bad_Gateway')
|
||||||
raise exception.WebDAVClientError(msg=msg,
|
raise WebDAVClientError(msg=msg, code=reason,
|
||||||
code=reason, src=src_file,
|
src=src_file,
|
||||||
dst=dst_file, method=method)
|
dst=dst_file, method=method)
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue