Merge "NetApp: set proper broadcast domain for IPspace"
This commit is contained in:
commit
7bbfcbaedf
@ -35,7 +35,6 @@ from manila.share.drivers.netapp import utils as na_utils
|
|||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
DELETED_PREFIX = 'deleted_manila_'
|
DELETED_PREFIX = 'deleted_manila_'
|
||||||
DEFAULT_IPSPACE = 'Default'
|
DEFAULT_IPSPACE = 'Default'
|
||||||
DEFAULT_BROADCAST_DOMAIN = 'OpenStack'
|
|
||||||
DEFAULT_MAX_PAGE_LENGTH = 50
|
DEFAULT_MAX_PAGE_LENGTH = 50
|
||||||
|
|
||||||
|
|
||||||
@ -605,7 +604,6 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
|
|||||||
|
|
||||||
@na_utils.trace
|
@na_utils.trace
|
||||||
def _ensure_broadcast_domain_for_port(self, node, port, mtu,
|
def _ensure_broadcast_domain_for_port(self, node, port, mtu,
|
||||||
domain=DEFAULT_BROADCAST_DOMAIN,
|
|
||||||
ipspace=DEFAULT_IPSPACE):
|
ipspace=DEFAULT_IPSPACE):
|
||||||
"""Ensure a port is in a broadcast domain. Create one if necessary.
|
"""Ensure a port is in a broadcast domain. Create one if necessary.
|
||||||
|
|
||||||
@ -613,10 +611,14 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
|
|||||||
happens in multi-node clusters, then there isn't anything to do.
|
happens in multi-node clusters, then there isn't anything to do.
|
||||||
Otherwise, we can assume the IPspace is correct and extant by this
|
Otherwise, we can assume the IPspace is correct and extant by this
|
||||||
point, so the remaining task is to remove the port from any domain it
|
point, so the remaining task is to remove the port from any domain it
|
||||||
is already in, create the desired domain if it doesn't exist, and add
|
is already in, create the domain for the IPspace if it doesn't exist,
|
||||||
the port to the desired domain.
|
and add the port to this domain.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Derive the broadcast domain name from the IPspace name since they
|
||||||
|
# need to be 1-1 and the default for both is the same name, 'Default'.
|
||||||
|
domain = re.sub(r'ipspace', 'domain', ipspace)
|
||||||
|
|
||||||
port_info = self._get_broadcast_domain_for_port(node, port)
|
port_info = self._get_broadcast_domain_for_port(node, port)
|
||||||
|
|
||||||
# Port already in desired ipspace and broadcast domain.
|
# Port already in desired ipspace and broadcast domain.
|
||||||
|
@ -1062,8 +1062,7 @@ class NetAppClientCmodeTestCase(test.TestCase):
|
|||||||
self.mock_object(self.client, '_add_port_to_broadcast_domain')
|
self.mock_object(self.client, '_add_port_to_broadcast_domain')
|
||||||
|
|
||||||
self.client._ensure_broadcast_domain_for_port(
|
self.client._ensure_broadcast_domain_for_port(
|
||||||
fake.NODE_NAME, fake.PORT, fake.MTU, domain=fake.BROADCAST_DOMAIN,
|
fake.NODE_NAME, fake.PORT, fake.MTU, ipspace=fake.IPSPACE_NAME)
|
||||||
ipspace=fake.IPSPACE_NAME)
|
|
||||||
|
|
||||||
self.client._get_broadcast_domain_for_port.assert_called_once_with(
|
self.client._get_broadcast_domain_for_port.assert_called_once_with(
|
||||||
fake.NODE_NAME, fake.PORT)
|
fake.NODE_NAME, fake.PORT)
|
||||||
@ -1073,10 +1072,11 @@ class NetAppClientCmodeTestCase(test.TestCase):
|
|||||||
self.assertFalse(self.client._create_broadcast_domain.called)
|
self.assertFalse(self.client._create_broadcast_domain.called)
|
||||||
self.assertFalse(self.client._add_port_to_broadcast_domain.called)
|
self.assertFalse(self.client._add_port_to_broadcast_domain.called)
|
||||||
|
|
||||||
def test_ensure_broadcast_domain_for_port_other_domain(self):
|
@ddt.data(fake.IPSPACE_NAME, client_cmode.DEFAULT_IPSPACE)
|
||||||
|
def test_ensure_broadcast_domain_for_port_other_domain(self, ipspace):
|
||||||
|
|
||||||
port_info = {
|
port_info = {
|
||||||
'ipspace': fake.IPSPACE_NAME,
|
'ipspace': ipspace,
|
||||||
'broadcast-domain': 'other_domain',
|
'broadcast-domain': 'other_domain',
|
||||||
}
|
}
|
||||||
self.mock_object(self.client,
|
self.mock_object(self.client,
|
||||||
@ -1091,13 +1091,12 @@ class NetAppClientCmodeTestCase(test.TestCase):
|
|||||||
self.mock_object(self.client, '_add_port_to_broadcast_domain')
|
self.mock_object(self.client, '_add_port_to_broadcast_domain')
|
||||||
|
|
||||||
self.client._ensure_broadcast_domain_for_port(
|
self.client._ensure_broadcast_domain_for_port(
|
||||||
fake.NODE_NAME, fake.PORT, domain=fake.BROADCAST_DOMAIN,
|
fake.NODE_NAME, fake.PORT, ipspace=fake.IPSPACE_NAME, mtu=fake.MTU)
|
||||||
ipspace=fake.IPSPACE_NAME, mtu=fake.MTU)
|
|
||||||
|
|
||||||
self.client._get_broadcast_domain_for_port.assert_called_once_with(
|
self.client._get_broadcast_domain_for_port.assert_called_once_with(
|
||||||
fake.NODE_NAME, fake.PORT)
|
fake.NODE_NAME, fake.PORT)
|
||||||
self.client._remove_port_from_broadcast_domain.assert_called_once_with(
|
self.client._remove_port_from_broadcast_domain.assert_called_once_with(
|
||||||
fake.NODE_NAME, fake.PORT, 'other_domain', fake.IPSPACE_NAME)
|
fake.NODE_NAME, fake.PORT, 'other_domain', ipspace)
|
||||||
self.client._broadcast_domain_exists.assert_called_once_with(
|
self.client._broadcast_domain_exists.assert_called_once_with(
|
||||||
fake.BROADCAST_DOMAIN, fake.IPSPACE_NAME)
|
fake.BROADCAST_DOMAIN, fake.IPSPACE_NAME)
|
||||||
self.assertFalse(self.client._create_broadcast_domain.called)
|
self.assertFalse(self.client._create_broadcast_domain.called)
|
||||||
@ -1125,8 +1124,7 @@ class NetAppClientCmodeTestCase(test.TestCase):
|
|||||||
self.mock_object(self.client, '_add_port_to_broadcast_domain')
|
self.mock_object(self.client, '_add_port_to_broadcast_domain')
|
||||||
|
|
||||||
self.client._ensure_broadcast_domain_for_port(
|
self.client._ensure_broadcast_domain_for_port(
|
||||||
fake.NODE_NAME, fake.PORT, domain=fake.BROADCAST_DOMAIN,
|
fake.NODE_NAME, fake.PORT, ipspace=fake.IPSPACE_NAME, mtu=fake.MTU)
|
||||||
ipspace=fake.IPSPACE_NAME, mtu=fake.MTU)
|
|
||||||
|
|
||||||
self.client._get_broadcast_domain_for_port.assert_called_once_with(
|
self.client._get_broadcast_domain_for_port.assert_called_once_with(
|
||||||
fake.NODE_NAME, fake.PORT)
|
fake.NODE_NAME, fake.PORT)
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- Changed NetApp cDOT driver when running with DHSS=True to maintain
|
||||||
|
a 1-1 relation between IPSpaces and broadcast domains.
|
Loading…
Reference in New Issue
Block a user