move brocade zone manager exceptions
This patch moves the brocade zone manager exceptions to brocade/exception.py Change-Id: Ia9f7107cde306271faeca49a8d3e447b3962c47b
This commit is contained in:
parent
05ddc36dd7
commit
659d4e390a
|
@ -1082,18 +1082,6 @@ class ZoneManagerNotInitialized(CinderException):
|
||||||
message = _("Fibre Channel Zone Manager not initialized")
|
message = _("Fibre Channel Zone Manager not initialized")
|
||||||
|
|
||||||
|
|
||||||
class BrocadeZoningCliException(CinderException):
|
|
||||||
message = _("Brocade Fibre Channel Zoning CLI error: %(reason)s")
|
|
||||||
|
|
||||||
|
|
||||||
class BrocadeZoningHttpException(CinderException):
|
|
||||||
message = _("Brocade Fibre Channel Zoning HTTP error: %(reason)s")
|
|
||||||
|
|
||||||
|
|
||||||
class BrocadeZoningRestException(CinderException):
|
|
||||||
message = _("Brocade Fibre Channel Zoning REST error: %(reason)s")
|
|
||||||
|
|
||||||
|
|
||||||
class CiscoZoningCliException(CinderException):
|
class CiscoZoningCliException(CinderException):
|
||||||
message = _("Cisco Fibre Channel Zoning CLI error: %(reason)s")
|
message = _("Cisco Fibre Channel Zoning CLI error: %(reason)s")
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ from cinder import exception
|
||||||
from cinder import test
|
from cinder import test
|
||||||
from cinder.zonemanager.drivers.brocade import (brcd_fc_zone_client_cli
|
from cinder.zonemanager.drivers.brocade import (brcd_fc_zone_client_cli
|
||||||
as client_cli)
|
as client_cli)
|
||||||
|
from cinder.zonemanager.drivers.brocade import exception as b_exception
|
||||||
import cinder.zonemanager.drivers.brocade.fc_zone_constants as zone_constant
|
import cinder.zonemanager.drivers.brocade.fc_zone_constants as zone_constant
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,7 +83,7 @@ class TestBrcdFCZoneClientCLI(client_cli.BrcdFCZoneClientCLI, test.TestCase):
|
||||||
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_run_ssh')
|
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_run_ssh')
|
||||||
def test_get_active_zone_set_ssh_error(self, run_ssh_mock):
|
def test_get_active_zone_set_ssh_error(self, run_ssh_mock):
|
||||||
run_ssh_mock.side_effect = processutils.ProcessExecutionError
|
run_ssh_mock.side_effect = processutils.ProcessExecutionError
|
||||||
self.assertRaises(exception.BrocadeZoningCliException,
|
self.assertRaises(b_exception.BrocadeZoningCliException,
|
||||||
self.get_active_zone_set)
|
self.get_active_zone_set)
|
||||||
|
|
||||||
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, 'get_active_zone_set')
|
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, 'get_active_zone_set')
|
||||||
|
@ -190,7 +191,7 @@ class TestBrcdFCZoneClientCLI(client_cli.BrcdFCZoneClientCLI, test.TestCase):
|
||||||
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_run_ssh')
|
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_run_ssh')
|
||||||
def test_get_nameserver_info_ssh_error(self, run_ssh_mock):
|
def test_get_nameserver_info_ssh_error(self, run_ssh_mock):
|
||||||
run_ssh_mock.side_effect = processutils.ProcessExecutionError
|
run_ssh_mock.side_effect = processutils.ProcessExecutionError
|
||||||
self.assertRaises(exception.BrocadeZoningCliException,
|
self.assertRaises(b_exception.BrocadeZoningCliException,
|
||||||
self.get_nameserver_info)
|
self.get_nameserver_info)
|
||||||
|
|
||||||
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_ssh_execute')
|
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_ssh_execute')
|
||||||
|
@ -228,7 +229,7 @@ class TestBrcdFCZoneClientCLI(client_cli.BrcdFCZoneClientCLI, test.TestCase):
|
||||||
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_run_ssh')
|
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_run_ssh')
|
||||||
def test__is_trans_abortable_ssh_error(self, run_ssh_mock):
|
def test__is_trans_abortable_ssh_error(self, run_ssh_mock):
|
||||||
run_ssh_mock.return_value = (Stream(), Stream())
|
run_ssh_mock.return_value = (Stream(), Stream())
|
||||||
self.assertRaises(exception.BrocadeZoningCliException,
|
self.assertRaises(b_exception.BrocadeZoningCliException,
|
||||||
self._is_trans_abortable)
|
self._is_trans_abortable)
|
||||||
|
|
||||||
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_run_ssh')
|
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_run_ssh')
|
||||||
|
@ -282,7 +283,7 @@ class TestBrcdFCZoneClientCLI(client_cli.BrcdFCZoneClientCLI, test.TestCase):
|
||||||
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_execute_shell_cmd')
|
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_execute_shell_cmd')
|
||||||
def test_is_supported_firmware_ssh_error(self, exec_shell_cmd_mock):
|
def test_is_supported_firmware_ssh_error(self, exec_shell_cmd_mock):
|
||||||
exec_shell_cmd_mock.side_effect = processutils.ProcessExecutionError
|
exec_shell_cmd_mock.side_effect = processutils.ProcessExecutionError
|
||||||
self.assertRaises(exception.BrocadeZoningCliException,
|
self.assertRaises(b_exception.BrocadeZoningCliException,
|
||||||
self.is_supported_firmware)
|
self.is_supported_firmware)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,10 @@ import mock
|
||||||
from mock import patch
|
from mock import patch
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from cinder import exception
|
|
||||||
from cinder import test
|
from cinder import test
|
||||||
from cinder.zonemanager.drivers.brocade import (brcd_http_fc_zone_client
|
from cinder.zonemanager.drivers.brocade import (brcd_http_fc_zone_client
|
||||||
as client)
|
as client)
|
||||||
|
from cinder.zonemanager.drivers.brocade import exception as b_exception
|
||||||
import cinder.zonemanager.drivers.brocade.fc_zone_constants as zone_constant
|
import cinder.zonemanager.drivers.brocade.fc_zone_constants as zone_constant
|
||||||
|
|
||||||
|
|
||||||
|
@ -496,7 +496,7 @@ class TestBrcdHttpFCZoneClient(client.BrcdHTTPFCZoneClient, test.TestCase):
|
||||||
def test_authenticate_failed(self, connect_mock):
|
def test_authenticate_failed(self, connect_mock):
|
||||||
connect_mock.return_value = un_authenticate_resp
|
connect_mock.return_value = un_authenticate_resp
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exception.BrocadeZoningHttpException, self.authenticate)
|
b_exception.BrocadeZoningHttpException, self.authenticate)
|
||||||
|
|
||||||
def test_get_parsed_data(self):
|
def test_get_parsed_data(self):
|
||||||
valid_delimiter1 = zone_constant.SWITCHINFO_BEGIN
|
valid_delimiter1 = zone_constant.SWITCHINFO_BEGIN
|
||||||
|
@ -504,12 +504,12 @@ class TestBrcdHttpFCZoneClient(client.BrcdHTTPFCZoneClient, test.TestCase):
|
||||||
invalid_delimiter = "--END SWITCH INFORMATION1"
|
invalid_delimiter = "--END SWITCH INFORMATION1"
|
||||||
self.assertEqual(parsed_value, self.get_parsed_data(
|
self.assertEqual(parsed_value, self.get_parsed_data(
|
||||||
switch_page_resp, valid_delimiter1, valid_delimiter2))
|
switch_page_resp, valid_delimiter1, valid_delimiter2))
|
||||||
self.assertRaises(exception.BrocadeZoningHttpException,
|
self.assertRaises(b_exception.BrocadeZoningHttpException,
|
||||||
self.get_parsed_data,
|
self.get_parsed_data,
|
||||||
switch_page_resp,
|
switch_page_resp,
|
||||||
valid_delimiter1,
|
valid_delimiter1,
|
||||||
invalid_delimiter)
|
invalid_delimiter)
|
||||||
self.assertRaises(exception.BrocadeZoningHttpException,
|
self.assertRaises(b_exception.BrocadeZoningHttpException,
|
||||||
self.get_parsed_data,
|
self.get_parsed_data,
|
||||||
switch_page_resp,
|
switch_page_resp,
|
||||||
invalid_delimiter,
|
invalid_delimiter,
|
||||||
|
@ -521,7 +521,7 @@ class TestBrcdHttpFCZoneClient(client.BrcdHTTPFCZoneClient, test.TestCase):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
"v7.3.0b_rc1_bld06", self.get_nvp_value(parsed_value,
|
"v7.3.0b_rc1_bld06", self.get_nvp_value(parsed_value,
|
||||||
valid_keyname))
|
valid_keyname))
|
||||||
self.assertRaises(exception.BrocadeZoningHttpException,
|
self.assertRaises(b_exception.BrocadeZoningHttpException,
|
||||||
self.get_nvp_value,
|
self.get_nvp_value,
|
||||||
parsed_value,
|
parsed_value,
|
||||||
invalid_keyname)
|
invalid_keyname)
|
||||||
|
@ -530,7 +530,7 @@ class TestBrcdHttpFCZoneClient(client.BrcdHTTPFCZoneClient, test.TestCase):
|
||||||
manageable_list = ['2', '128']
|
manageable_list = ['2', '128']
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
manageable_list, self.get_managable_vf_list(session_info_vf))
|
manageable_list, self.get_managable_vf_list(session_info_vf))
|
||||||
self.assertRaises(exception.BrocadeZoningHttpException,
|
self.assertRaises(b_exception.BrocadeZoningHttpException,
|
||||||
self.get_managable_vf_list, session_info_AD)
|
self.get_managable_vf_list, session_info_AD)
|
||||||
|
|
||||||
@mock.patch.object(client.BrcdHTTPFCZoneClient, 'is_vf_enabled')
|
@mock.patch.object(client.BrcdHTTPFCZoneClient, 'is_vf_enabled')
|
||||||
|
@ -538,7 +538,7 @@ class TestBrcdHttpFCZoneClient(client.BrcdHTTPFCZoneClient, test.TestCase):
|
||||||
is_vf_enabled_mock.return_value = (True, session_info_vf)
|
is_vf_enabled_mock.return_value = (True, session_info_vf)
|
||||||
self.vfid = None
|
self.vfid = None
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exception.BrocadeZoningHttpException,
|
b_exception.BrocadeZoningHttpException,
|
||||||
self.check_change_vf_context)
|
self.check_change_vf_context)
|
||||||
self.vfid = "2"
|
self.vfid = "2"
|
||||||
with mock.patch.object(self, 'change_vf_context') \
|
with mock.patch.object(self, 'change_vf_context') \
|
||||||
|
@ -552,7 +552,7 @@ class TestBrcdHttpFCZoneClient(client.BrcdHTTPFCZoneClient, test.TestCase):
|
||||||
is_vf_enabled_mock.return_value = (False, session_info_AD)
|
is_vf_enabled_mock.return_value = (False, session_info_AD)
|
||||||
self.vfid = "128"
|
self.vfid = "128"
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exception.BrocadeZoningHttpException,
|
b_exception.BrocadeZoningHttpException,
|
||||||
self.check_change_vf_context)
|
self.check_change_vf_context)
|
||||||
|
|
||||||
@mock.patch.object(client.BrcdHTTPFCZoneClient, 'get_managable_vf_list')
|
@mock.patch.object(client.BrcdHTTPFCZoneClient, 'get_managable_vf_list')
|
||||||
|
@ -575,7 +575,7 @@ class TestBrcdHttpFCZoneClient(client.BrcdHTTPFCZoneClient, test.TestCase):
|
||||||
get_managable_vf_list_mock):
|
get_managable_vf_list_mock):
|
||||||
get_managable_vf_list_mock.return_value = ['2', '128']
|
get_managable_vf_list_mock.return_value = ['2', '128']
|
||||||
connect_mock.return_value = session_info_vf_not_changed
|
connect_mock.return_value = session_info_vf_not_changed
|
||||||
self.assertRaises(exception.BrocadeZoningHttpException,
|
self.assertRaises(b_exception.BrocadeZoningHttpException,
|
||||||
self.change_vf_context, "2", session_info_vf)
|
self.change_vf_context, "2", session_info_vf)
|
||||||
data = zone_constant.CHANGE_VF.format(vfid="2")
|
data = zone_constant.CHANGE_VF.format(vfid="2")
|
||||||
headers = {zone_constant.AUTH_HEADER: self.auth_header}
|
headers = {zone_constant.AUTH_HEADER: self.auth_header}
|
||||||
|
@ -587,7 +587,7 @@ class TestBrcdHttpFCZoneClient(client.BrcdHTTPFCZoneClient, test.TestCase):
|
||||||
def test_change_vf_context_vfid_not_managaed(self,
|
def test_change_vf_context_vfid_not_managaed(self,
|
||||||
get_managable_vf_list_mock):
|
get_managable_vf_list_mock):
|
||||||
get_managable_vf_list_mock.return_value = ['2', '128']
|
get_managable_vf_list_mock.return_value = ['2', '128']
|
||||||
self.assertRaises(exception.BrocadeZoningHttpException,
|
self.assertRaises(b_exception.BrocadeZoningHttpException,
|
||||||
self.change_vf_context, "12", session_info_vf)
|
self.change_vf_context, "12", session_info_vf)
|
||||||
|
|
||||||
@patch.object(client.BrcdHTTPFCZoneClient, 'connect')
|
@patch.object(client.BrcdHTTPFCZoneClient, 'connect')
|
||||||
|
@ -655,7 +655,7 @@ class TestBrcdHttpFCZoneClient(client.BrcdHTTPFCZoneClient, test.TestCase):
|
||||||
'20:19:00:05:1e:e8:e3:29']
|
'20:19:00:05:1e:e8:e3:29']
|
||||||
}
|
}
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exception.BrocadeZoningHttpException,
|
b_exception.BrocadeZoningHttpException,
|
||||||
self.add_zones, add_zones_info, False)
|
self.add_zones, add_zones_info, False)
|
||||||
|
|
||||||
@patch.object(client.BrcdHTTPFCZoneClient, 'post_zone_data')
|
@patch.object(client.BrcdHTTPFCZoneClient, 'post_zone_data')
|
||||||
|
@ -714,7 +714,7 @@ class TestBrcdHttpFCZoneClient(client.BrcdHTTPFCZoneClient, test.TestCase):
|
||||||
self.ifas = ifas.copy()
|
self.ifas = ifas.copy()
|
||||||
self.active_cfg = active_cfg
|
self.active_cfg = active_cfg
|
||||||
delete_zones_info = 'openstack50060b0000c26604201900051ee8e32'
|
delete_zones_info = 'openstack50060b0000c26604201900051ee8e32'
|
||||||
self.assertRaises(exception.BrocadeZoningHttpException,
|
self.assertRaises(b_exception.BrocadeZoningHttpException,
|
||||||
self.delete_zones, delete_zones_info, False)
|
self.delete_zones, delete_zones_info, False)
|
||||||
|
|
||||||
@patch.object(time, 'sleep')
|
@patch.object(time, 'sleep')
|
||||||
|
|
|
@ -32,6 +32,7 @@ from cinder import exception
|
||||||
from cinder.i18n import _
|
from cinder.i18n import _
|
||||||
from cinder import ssh_utils
|
from cinder import ssh_utils
|
||||||
from cinder import utils
|
from cinder import utils
|
||||||
|
from cinder.zonemanager.drivers.brocade import exception as b_exception
|
||||||
import cinder.zonemanager.drivers.brocade.fc_zone_constants as zone_constant
|
import cinder.zonemanager.drivers.brocade.fc_zone_constants as zone_constant
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -82,7 +83,7 @@ class BrcdFCZoneClientCLI(object):
|
||||||
try:
|
try:
|
||||||
switch_data = self._get_switch_info(
|
switch_data = self._get_switch_info(
|
||||||
[zone_constant.GET_ACTIVE_ZONE_CFG])
|
[zone_constant.GET_ACTIVE_ZONE_CFG])
|
||||||
except exception.BrocadeZoningCliException:
|
except b_exception.BrocadeZoningCliException:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error("Failed getting active zone set "
|
LOG.error("Failed getting active zone set "
|
||||||
"from fabric %s", self.switch_ip)
|
"from fabric %s", self.switch_ip)
|
||||||
|
@ -196,7 +197,7 @@ class BrcdFCZoneClientCLI(object):
|
||||||
"(Zone set=%(cfg_name)s error=%(err)s)."
|
"(Zone set=%(cfg_name)s error=%(err)s)."
|
||||||
) % {'cfg_name': cfg_name, 'err': six.text_type(e)}
|
) % {'cfg_name': cfg_name, 'err': six.text_type(e)}
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningCliException(reason=msg)
|
raise b_exception.BrocadeZoningCliException(reason=msg)
|
||||||
|
|
||||||
def update_zones(self, zones, activate, operation, active_zone_set=None):
|
def update_zones(self, zones, activate, operation, active_zone_set=None):
|
||||||
"""Update the zone configuration.
|
"""Update the zone configuration.
|
||||||
|
@ -261,7 +262,7 @@ class BrcdFCZoneClientCLI(object):
|
||||||
"(Zone set=%(cfg_name)s error=%(err)s)."
|
"(Zone set=%(cfg_name)s error=%(err)s)."
|
||||||
) % {'cfg_name': cfg_name, 'err': six.text_type(e)}
|
) % {'cfg_name': cfg_name, 'err': six.text_type(e)}
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningCliException(reason=msg)
|
raise b_exception.BrocadeZoningCliException(reason=msg)
|
||||||
|
|
||||||
def activate_zoneset(self, cfgname):
|
def activate_zoneset(self, cfgname):
|
||||||
"""Method to Activate the zone config. Param cfgname - ZonesetName."""
|
"""Method to Activate the zone config. Param cfgname - ZonesetName."""
|
||||||
|
@ -316,7 +317,7 @@ class BrcdFCZoneClientCLI(object):
|
||||||
) % {'cmd': cmd, 'err': six.text_type(e)}
|
) % {'cmd': cmd, 'err': six.text_type(e)}
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
self._cfg_trans_abort()
|
self._cfg_trans_abort()
|
||||||
raise exception.BrocadeZoningCliException(reason=msg)
|
raise b_exception.BrocadeZoningCliException(reason=msg)
|
||||||
|
|
||||||
def get_nameserver_info(self):
|
def get_nameserver_info(self):
|
||||||
"""Get name server data from fabric.
|
"""Get name server data from fabric.
|
||||||
|
@ -331,7 +332,7 @@ class BrcdFCZoneClientCLI(object):
|
||||||
'nsshow': zone_constant.NS_SHOW,
|
'nsshow': zone_constant.NS_SHOW,
|
||||||
'nscamshow': zone_constant.NS_CAM_SHOW}
|
'nscamshow': zone_constant.NS_CAM_SHOW}
|
||||||
cli_output = self._get_switch_info([cmd])
|
cli_output = self._get_switch_info([cmd])
|
||||||
except exception.BrocadeZoningCliException:
|
except b_exception.BrocadeZoningCliException:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error("Failed collecting nsshow "
|
LOG.error("Failed collecting nsshow "
|
||||||
"info for fabric %s", self.switch_ip)
|
"info for fabric %s", self.switch_ip)
|
||||||
|
@ -365,7 +366,7 @@ class BrcdFCZoneClientCLI(object):
|
||||||
break
|
break
|
||||||
if stderr:
|
if stderr:
|
||||||
msg = _("Error while checking transaction status: %s") % stderr
|
msg = _("Error while checking transaction status: %s") % stderr
|
||||||
raise exception.BrocadeZoningCliException(reason=msg)
|
raise b_exception.BrocadeZoningCliException(reason=msg)
|
||||||
else:
|
else:
|
||||||
return is_abortable
|
return is_abortable
|
||||||
|
|
||||||
|
@ -384,7 +385,7 @@ class BrcdFCZoneClientCLI(object):
|
||||||
"error=%(err)s).") % {'cmd': cmd_list, 'err': stdout}
|
"error=%(err)s).") % {'cmd': cmd_list, 'err': stdout}
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
self._cfg_trans_abort()
|
self._cfg_trans_abort()
|
||||||
raise exception.BrocadeZoningCliException(reason=msg)
|
raise b_exception.BrocadeZoningCliException(reason=msg)
|
||||||
|
|
||||||
def is_supported_firmware(self):
|
def is_supported_firmware(self):
|
||||||
"""Check firmware version is v6.4 or higher.
|
"""Check firmware version is v6.4 or higher.
|
||||||
|
@ -411,7 +412,7 @@ class BrcdFCZoneClientCLI(object):
|
||||||
msg = _("Error while getting data via ssh: (command=%(cmd)s "
|
msg = _("Error while getting data via ssh: (command=%(cmd)s "
|
||||||
"error=%(err)s).") % {'cmd': cmd, 'err': six.text_type(e)}
|
"error=%(err)s).") % {'cmd': cmd, 'err': six.text_type(e)}
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningCliException(reason=msg)
|
raise b_exception.BrocadeZoningCliException(reason=msg)
|
||||||
|
|
||||||
def _get_switch_info(self, cmd_list):
|
def _get_switch_info(self, cmd_list):
|
||||||
stdout, stderr, sw_data = None, None, None
|
stdout, stderr, sw_data = None, None, None
|
||||||
|
@ -425,7 +426,7 @@ class BrcdFCZoneClientCLI(object):
|
||||||
"error=%(err)s).") % {'cmd': cmd_list,
|
"error=%(err)s).") % {'cmd': cmd_list,
|
||||||
'err': six.text_type(e)}
|
'err': six.text_type(e)}
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningCliException(reason=msg)
|
raise b_exception.BrocadeZoningCliException(reason=msg)
|
||||||
|
|
||||||
def _parse_ns_output(self, switch_data):
|
def _parse_ns_output(self, switch_data):
|
||||||
"""Parses name server data.
|
"""Parses name server data.
|
||||||
|
|
|
@ -40,6 +40,7 @@ from cinder import exception
|
||||||
from cinder.i18n import _
|
from cinder.i18n import _
|
||||||
from cinder import interface
|
from cinder import interface
|
||||||
from cinder.zonemanager.drivers.brocade import brcd_fabric_opts as fabric_opts
|
from cinder.zonemanager.drivers.brocade import brcd_fabric_opts as fabric_opts
|
||||||
|
from cinder.zonemanager.drivers.brocade import exception as b_exception
|
||||||
from cinder.zonemanager.drivers.brocade import fc_zone_constants
|
from cinder.zonemanager.drivers.brocade import fc_zone_constants
|
||||||
from cinder.zonemanager.drivers import driver_utils
|
from cinder.zonemanager.drivers import driver_utils
|
||||||
from cinder.zonemanager.drivers import fc_zone_driver
|
from cinder.zonemanager.drivers import fc_zone_driver
|
||||||
|
@ -232,9 +233,9 @@ class BrcdFCZoneDriver(fc_zone_driver.FCZoneDriver):
|
||||||
cfgmap_from_fabric)
|
cfgmap_from_fabric)
|
||||||
LOG.debug("Zones updated successfully: %(updatemap)s",
|
LOG.debug("Zones updated successfully: %(updatemap)s",
|
||||||
{'updatemap': zone_update_map})
|
{'updatemap': zone_update_map})
|
||||||
except (exception.BrocadeZoningCliException,
|
except (b_exception.BrocadeZoningCliException,
|
||||||
exception.BrocadeZoningHttpException,
|
b_exception.BrocadeZoningHttpException,
|
||||||
exception.BrocadeZoningRestException) as brocade_ex:
|
b_exception.BrocadeZoningRestException) as brocade_ex:
|
||||||
raise exception.FCZoneDriverException(brocade_ex)
|
raise exception.FCZoneDriverException(brocade_ex)
|
||||||
except Exception:
|
except Exception:
|
||||||
msg = _("Failed to add or update zoning configuration.")
|
msg = _("Failed to add or update zoning configuration.")
|
||||||
|
@ -380,9 +381,9 @@ class BrcdFCZoneDriver(fc_zone_driver.FCZoneDriver):
|
||||||
conn.delete_zones(
|
conn.delete_zones(
|
||||||
zone_name_string, zone_activate,
|
zone_name_string, zone_activate,
|
||||||
cfgmap_from_fabric)
|
cfgmap_from_fabric)
|
||||||
except (exception.BrocadeZoningCliException,
|
except (b_exception.BrocadeZoningCliException,
|
||||||
exception.BrocadeZoningHttpException,
|
b_exception.BrocadeZoningHttpException,
|
||||||
exception.BrocadeZoningRestException) as brocade_ex:
|
b_exception.BrocadeZoningRestException) as brocade_ex:
|
||||||
raise exception.FCZoneDriverException(brocade_ex)
|
raise exception.FCZoneDriverException(brocade_ex)
|
||||||
except Exception:
|
except Exception:
|
||||||
msg = _("Failed to update or delete zoning "
|
msg = _("Failed to update or delete zoning "
|
||||||
|
@ -420,8 +421,8 @@ class BrcdFCZoneDriver(fc_zone_driver.FCZoneDriver):
|
||||||
nsinfo = conn.get_nameserver_info()
|
nsinfo = conn.get_nameserver_info()
|
||||||
LOG.debug("Name server info from fabric: %(nsinfo)s",
|
LOG.debug("Name server info from fabric: %(nsinfo)s",
|
||||||
{'nsinfo': nsinfo})
|
{'nsinfo': nsinfo})
|
||||||
except (exception.BrocadeZoningCliException,
|
except (b_exception.BrocadeZoningCliException,
|
||||||
exception.BrocadeZoningHttpException):
|
b_exception.BrocadeZoningHttpException):
|
||||||
if not conn.is_supported_firmware():
|
if not conn.is_supported_firmware():
|
||||||
msg = _("Unsupported firmware on switch %s. Make sure "
|
msg = _("Unsupported firmware on switch %s. Make sure "
|
||||||
"switch is running firmware v6.4 or higher"
|
"switch is running firmware v6.4 or higher"
|
||||||
|
@ -460,8 +461,8 @@ class BrcdFCZoneDriver(fc_zone_driver.FCZoneDriver):
|
||||||
cfgmap = None
|
cfgmap = None
|
||||||
try:
|
try:
|
||||||
cfgmap = conn.get_active_zone_set()
|
cfgmap = conn.get_active_zone_set()
|
||||||
except (exception.BrocadeZoningCliException,
|
except (b_exception.BrocadeZoningCliException,
|
||||||
exception.BrocadeZoningHttpException):
|
b_exception.BrocadeZoningHttpException):
|
||||||
if not conn.is_supported_firmware():
|
if not conn.is_supported_firmware():
|
||||||
msg = _("Unsupported firmware on switch %s. Make sure "
|
msg = _("Unsupported firmware on switch %s. Make sure "
|
||||||
"switch is running firmware v6.4 or higher"
|
"switch is running firmware v6.4 or higher"
|
||||||
|
|
|
@ -26,8 +26,8 @@ from oslo_log import log as logging
|
||||||
from oslo_serialization import base64
|
from oslo_serialization import base64
|
||||||
from oslo_utils import encodeutils
|
from oslo_utils import encodeutils
|
||||||
|
|
||||||
from cinder import exception
|
|
||||||
from cinder.i18n import _
|
from cinder.i18n import _
|
||||||
|
from cinder.zonemanager.drivers.brocade import exception as b_exception
|
||||||
import cinder.zonemanager.drivers.brocade.fc_zone_constants as zone_constant
|
import cinder.zonemanager.drivers.brocade.fc_zone_constants as zone_constant
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
msg = _("Error while querying page %(url)s on the switch, "
|
msg = _("Error while querying page %(url)s on the switch, "
|
||||||
"reason %(error)s.") % {'url': url,
|
"reason %(error)s.") % {'url': url,
|
||||||
'error': response.reason}
|
'error': response.reason}
|
||||||
raise exception.BrocadeZoningHttpException(msg)
|
raise b_exception.BrocadeZoningHttpException(msg)
|
||||||
else:
|
else:
|
||||||
return response.text
|
return response.text
|
||||||
except requests.exceptions.ConnectionError as e:
|
except requests.exceptions.ConnectionError as e:
|
||||||
|
@ -127,8 +127,8 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
'protocol': self.protocol,
|
'protocol': self.protocol,
|
||||||
'error': six.text_type(e)})
|
'error': six.text_type(e)})
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
except exception.BrocadeZoningHttpException as ex:
|
except b_exception.BrocadeZoningHttpException as ex:
|
||||||
msg = (_("Unexpected status code from the switch %(switch_id)s "
|
msg = (_("Unexpected status code from the switch %(switch_id)s "
|
||||||
"with protocol %(protocol)s for url %(page)s. "
|
"with protocol %(protocol)s for url %(page)s. "
|
||||||
"Error: %(error)s")
|
"Error: %(error)s")
|
||||||
|
@ -137,7 +137,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
'page': requestURL,
|
'page': requestURL,
|
||||||
'error': six.text_type(ex)})
|
'error': six.text_type(ex)})
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def create_auth_token(self):
|
def create_auth_token(self):
|
||||||
"""Create the authentication token.
|
"""Create the authentication token.
|
||||||
|
@ -176,7 +176,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
msg = (_("Error while creating authentication token: %s")
|
msg = (_("Error while creating authentication token: %s")
|
||||||
% six.text_type(e))
|
% six.text_type(e))
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
return auth_header
|
return auth_header
|
||||||
|
|
||||||
def authenticate(self):
|
def authenticate(self):
|
||||||
|
@ -216,12 +216,12 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
msg = (_("Authentication failed, verify the switch "
|
msg = (_("Authentication failed, verify the switch "
|
||||||
"credentials, error code %s.") % auth_error_code)
|
"credentials, error code %s.") % auth_error_code)
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = (_("Error while authenticating with switch: %s.")
|
msg = (_("Error while authenticating with switch: %s.")
|
||||||
% six.text_type(e))
|
% six.text_type(e))
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def get_session_info(self):
|
def get_session_info(self):
|
||||||
"""Get the session information from the switch
|
"""Get the session information from the switch
|
||||||
|
@ -238,7 +238,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
msg = (_("Error while getting session information %s.")
|
msg = (_("Error while getting session information %s.")
|
||||||
% six.text_type(e))
|
% six.text_type(e))
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def get_parsed_data(self, data, delim1, delim2):
|
def get_parsed_data(self, data, delim1, delim2):
|
||||||
|
@ -257,7 +257,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
msg = (_("Error while parsing the data: %s.") % six.text_type(e))
|
msg = (_("Error while parsing the data: %s.") % six.text_type(e))
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def get_nvp_value(self, data, keyname):
|
def get_nvp_value(self, data, keyname):
|
||||||
"""Get the value for the key passed.
|
"""Get the value for the key passed.
|
||||||
|
@ -275,7 +275,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
msg = (_("Error while getting nvp value: %s.") % six.text_type(e))
|
msg = (_("Error while getting nvp value: %s.") % six.text_type(e))
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def get_managable_vf_list(self, session_info):
|
def get_managable_vf_list(self, session_info):
|
||||||
"""List of VFIDs that can be managed.
|
"""List of VFIDs that can be managed.
|
||||||
|
@ -291,11 +291,11 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
zone_constant.MANAGEABLE_VF)
|
zone_constant.MANAGEABLE_VF)
|
||||||
if vf_list:
|
if vf_list:
|
||||||
vf_list = vf_list.split(",") # convert the string to list
|
vf_list = vf_list.split(",") # convert the string to list
|
||||||
except exception.BrocadeZoningHttpException as e:
|
except b_exception.BrocadeZoningHttpException as e:
|
||||||
msg = (_("Error while checking whether "
|
msg = (_("Error while checking whether "
|
||||||
"VF is available for management %s.") % six.text_type(e))
|
"VF is available for management %s.") % six.text_type(e))
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
return vf_list[:-1]
|
return vf_list[:-1]
|
||||||
|
|
||||||
def change_vf_context(self, vfid, session_data):
|
def change_vf_context(self, vfid, session_data):
|
||||||
|
@ -328,7 +328,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
else:
|
else:
|
||||||
msg = _("Cannot change VF context in the session.")
|
msg = _("Cannot change VF context in the session.")
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
msg = (_("Cannot change VF context, "
|
msg = (_("Cannot change VF context, "
|
||||||
|
@ -336,11 +336,11 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
"in the manageable VF list %(vf_list)s.")
|
"in the manageable VF list %(vf_list)s.")
|
||||||
% {'vf_list': managable_vf_list})
|
% {'vf_list': managable_vf_list})
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
except exception.BrocadeZoningHttpException as e:
|
except b_exception.BrocadeZoningHttpException as e:
|
||||||
msg = (_("Error while changing VF context %s.") % six.text_type(e))
|
msg = (_("Error while changing VF context %s.") % six.text_type(e))
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def get_zone_info(self):
|
def get_zone_info(self):
|
||||||
"""Parse all the zone information and store it in the dictionary."""
|
"""Parse all the zone information and store it in the dictionary."""
|
||||||
|
@ -415,7 +415,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = (_("Error while changing VF context %s.") % six.text_type(e))
|
msg = (_("Error while changing VF context %s.") % six.text_type(e))
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def is_supported_firmware(self):
|
def is_supported_firmware(self):
|
||||||
"""Check firmware version is v6.4 or higher.
|
"""Check firmware version is v6.4 or higher.
|
||||||
|
@ -453,7 +453,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
msg = (_("Error while checking the firmware version %s.")
|
msg = (_("Error while checking the firmware version %s.")
|
||||||
% six.text_type(e))
|
% six.text_type(e))
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
return isfwsupported
|
return isfwsupported
|
||||||
|
|
||||||
def get_active_zone_set(self):
|
def get_active_zone_set(self):
|
||||||
|
@ -495,7 +495,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
msg = (_("Failed getting active zone set from fabric %s.")
|
msg = (_("Failed getting active zone set from fabric %s.")
|
||||||
% six.text_type(e))
|
% six.text_type(e))
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def add_zones(self, add_zones_info, activate, active_zone_set=None):
|
def add_zones(self, add_zones_info, activate, active_zone_set=None):
|
||||||
"""Add zone configuration.
|
"""Add zone configuration.
|
||||||
|
@ -555,7 +555,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
% {'err_code': error_code, 'err_msg': error_msg})
|
% {'err_code': error_code, 'err_msg': error_msg})
|
||||||
|
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def update_zones(self, zone_info, activate, operation,
|
def update_zones(self, zone_info, activate, operation,
|
||||||
active_zone_set=None):
|
active_zone_set=None):
|
||||||
|
@ -612,7 +612,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
% {'err_code': error_code, 'err_msg': error_msg})
|
% {'err_code': error_code, 'err_msg': error_msg})
|
||||||
|
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def form_zone_string(self, cfgs, active_cfg,
|
def form_zone_string(self, cfgs, active_cfg,
|
||||||
zones, alias, qlps, ifas, activate):
|
zones, alias, qlps, ifas, activate):
|
||||||
|
@ -661,7 +661,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
msg = (_("Exception while forming the zone string: %s.")
|
msg = (_("Exception while forming the zone string: %s.")
|
||||||
% six.text_type(e))
|
% six.text_type(e))
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
# Reconstruct the zoneString to type base string for OpenSSL
|
# Reconstruct the zoneString to type base string for OpenSSL
|
||||||
return encodeutils.safe_encode(zoneString)
|
return encodeutils.safe_encode(zoneString)
|
||||||
|
|
||||||
|
@ -708,7 +708,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
"in the zone string. Error %(description)s.")
|
"in the zone string. Error %(description)s.")
|
||||||
% {'description': six.text_type(e)})
|
% {'description': six.text_type(e)})
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
return zones, cfgs, active_cfg
|
return zones, cfgs, active_cfg
|
||||||
|
|
||||||
def _update_zones(self, zones, updated_zones_info, operation):
|
def _update_zones(self, zones, updated_zones_info, operation):
|
||||||
|
@ -744,7 +744,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
"in the zone string. Error %(description)s.")
|
"in the zone string. Error %(description)s.")
|
||||||
% {'description': six.text_type(e)})
|
% {'description': six.text_type(e)})
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
return zones
|
return zones
|
||||||
|
|
||||||
def is_vf_enabled(self):
|
def is_vf_enabled(self):
|
||||||
|
@ -759,7 +759,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
try:
|
try:
|
||||||
is_vf_enabled = bool(self.get_nvp_value(
|
is_vf_enabled = bool(self.get_nvp_value(
|
||||||
parsed_data, zone_constant.VF_ENABLED))
|
parsed_data, zone_constant.VF_ENABLED))
|
||||||
except exception.BrocadeZoningHttpException:
|
except b_exception.BrocadeZoningHttpException:
|
||||||
is_vf_enabled = False
|
is_vf_enabled = False
|
||||||
parsed_data = None
|
parsed_data = None
|
||||||
return is_vf_enabled, parsed_data
|
return is_vf_enabled, parsed_data
|
||||||
|
@ -827,7 +827,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
"in the zone string: %(description)s.")
|
"in the zone string: %(description)s.")
|
||||||
% {'description': six.text_type(e)})
|
% {'description': six.text_type(e)})
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
return zones, cfgs, active_cfg
|
return zones, cfgs, active_cfg
|
||||||
|
|
||||||
def delete_zones(self, delete_zones_info, activate, active_zone_set=None):
|
def delete_zones(self, delete_zones_info, activate, active_zone_set=None):
|
||||||
|
@ -869,7 +869,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
"(error code=%(err_code)s error msg=%(err_msg)s.")
|
"(error code=%(err_code)s error msg=%(err_msg)s.")
|
||||||
% {'err_code': error_code, 'err_msg': error_msg})
|
% {'err_code': error_code, 'err_msg': error_msg})
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def post_zone_data(self, data):
|
def post_zone_data(self, data):
|
||||||
"""Send POST request to the switch with the payload.
|
"""Send POST request to the switch with the payload.
|
||||||
|
@ -930,14 +930,14 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
if self.vfid is None:
|
if self.vfid is None:
|
||||||
msg = _("No VF ID is defined in the configuration file.")
|
msg = _("No VF ID is defined in the configuration file.")
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
elif self.vfid != 128:
|
elif self.vfid != 128:
|
||||||
self.change_vf_context(self.vfid, session_data)
|
self.change_vf_context(self.vfid, session_data)
|
||||||
else:
|
else:
|
||||||
if self.vfid is not None:
|
if self.vfid is not None:
|
||||||
msg = _("VF is not enabled.")
|
msg = _("VF is not enabled.")
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def _disconnect(self):
|
def _disconnect(self):
|
||||||
"""Disconnect from the switch using HTTP/HTTPS protocol.
|
"""Disconnect from the switch using HTTP/HTTPS protocol.
|
||||||
|
@ -957,8 +957,8 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
'protocol': self.protocol,
|
'protocol': self.protocol,
|
||||||
'error': six.text_type(e)})
|
'error': six.text_type(e)})
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
except exception.BrocadeZoningHttpException as ex:
|
except b_exception.BrocadeZoningHttpException as ex:
|
||||||
msg = (_("Unexpected status code from the switch %(switch_id)s "
|
msg = (_("Unexpected status code from the switch %(switch_id)s "
|
||||||
"with protocol %(protocol)s for url %(page)s. "
|
"with protocol %(protocol)s for url %(page)s. "
|
||||||
"Error: %(error)s")
|
"Error: %(error)s")
|
||||||
|
@ -967,7 +967,7 @@ class BrcdHTTPFCZoneClient(object):
|
||||||
'page': zone_constant.LOGOUT_PAGE,
|
'page': zone_constant.LOGOUT_PAGE,
|
||||||
'error': six.text_type(ex)})
|
'error': six.text_type(ex)})
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.BrocadeZoningHttpException(reason=msg)
|
raise b_exception.BrocadeZoningHttpException(reason=msg)
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""Close session."""
|
"""Close session."""
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
|
from cinder import exception
|
||||||
|
from cinder.i18n import _
|
||||||
|
|
||||||
|
|
||||||
|
class BrocadeZoningCliException(exception.CinderException):
|
||||||
|
message = _("Brocade Fibre Channel Zoning CLI error: %(reason)s")
|
||||||
|
|
||||||
|
|
||||||
|
class BrocadeZoningHttpException(exception.CinderException):
|
||||||
|
message = _("Brocade Fibre Channel Zoning HTTP error: %(reason)s")
|
||||||
|
|
||||||
|
|
||||||
|
class BrocadeZoningRestException(exception.CinderException):
|
||||||
|
message = _("Brocade Fibre Channel Zoning REST error: %(reason)s")
|
Loading…
Reference in New Issue