Browse Source

Fix [Unity] verification and convert mgmt ipv6

The IPv6 format need change to [ipv6]
Add bug fix release note

Change-Id: I21fa6f3e55f45b058df8f25a44b7f939c409329b
Closes-bug: #1845135
(cherry picked from commit 923edff726)
(cherry picked from commit 9da5594fbd)
(cherry picked from commit 90a68770e2)
(cherry picked from commit 7543bd8bde)
tags/6.3.2^0
dingd 4 months ago
parent
commit
f4bc383de1
5 changed files with 32 additions and 2 deletions
  1. +6
    -2
      manila/share/drivers/dell_emc/plugins/unity/connection.py
  2. +3
    -0
      manila/tests/share/drivers/dell_emc/plugins/unity/mocked_unity.yaml
  3. +13
    -0
      manila/tests/share/drivers/dell_emc/plugins/unity/res_mock.py
  4. +5
    -0
      manila/tests/share/drivers/dell_emc/plugins/unity/test_connection.py
  5. +5
    -0
      releasenotes/notes/bug-1845135-fix-Unity-cannot-use-mgmt-ipv6-9407710a3fc7f4aa.yaml

+ 6
- 2
manila/share/drivers/dell_emc/plugins/unity/connection.py View File

@@ -36,7 +36,10 @@ from manila.share.drivers.dell_emc.plugins.unity import utils as unity_utils
from manila.share import utils as share_utils
from manila import utils

VERSION = "4.0.0"
VERSION = "4.0.1"
"""Version history:
4.0.1 - Fix parsing management IPv6 address
"""

LOG = log.getLogger(__name__)
SUPPORTED_NETWORK_TYPES = (None, 'flat', 'vlan')
@@ -93,7 +96,8 @@ class UnityStorageConnection(driver.StorageConnection):
def connect(self, emc_share_driver, context):
"""Connect to Unity storage."""
config = emc_share_driver.configuration
storage_ip = config.emc_nas_server
storage_ip = enas_utils.convert_ipv6_format_if_needed(
config.emc_nas_server)
username = config.emc_nas_login
password = config.emc_nas_password
self.client = client.UnityClient(storage_ip, username, password)

+ 3
- 0
manila/tests/share/drivers/dell_emc/plugins/unity/mocked_unity.yaml View File

@@ -183,6 +183,9 @@ unity_base: &unity_base
test_connect: &test_connect
unity: *unity_base

test_connect_with_ipv6: &test_connect_with_ipv6
unity: *unity_base

test_connect__invalid_sp_configuration:
unity:
_methods:

+ 13
- 0
manila/tests/share/drivers/dell_emc/plugins/unity/res_mock.py View File

@@ -96,6 +96,19 @@ class FakeEMCShareDriver(object):
self.configuration.local_conf.max_over_subscription_ratio = 20


class FakeEMCShareDriverIPv6(object):
def __init__(self, dhss=None):
self.configuration = conf.Configuration(None)
self.configuration.emc_share_backend = 'unity'
self.configuration.emc_nas_server = 'fa27:2a95:e734:0:0:0:0:01'
self.configuration.emc_nas_login = 'fake_user'
self.configuration.emc_nas_password = 'fake_password'
self.configuration.share_backend_name = 'EMC_NAS_Storage'
self.configuration.vnx_server_meta_pool = 'nas_server_pool'
self.configuration.unity_server_meta_pool = 'nas_server_pool'
self.configuration.local_conf.max_over_subscription_ratio = 20


STATS = dict(
share_backend_name='Unity',
vendor_name='EMC',

+ 5
- 0
manila/tests/share/drivers/dell_emc/plugins/unity/test_connection.py View File

@@ -38,6 +38,11 @@ class TestConnection(test.TestCase):
def test_connect(self, connection):
connection.connect(res_mock.FakeEMCShareDriver(), None)

@res_mock.patch_connection_init
def test_connect_with_ipv6(self, connection):
connection.connect(res_mock.FakeEMCShareDriverIPv6(),
None)

@res_mock.patch_connection
def test_connect__invalid_pool_configuration(self, connection):
f = connection.client.system.get_pool

+ 5
- 0
releasenotes/notes/bug-1845135-fix-Unity-cannot-use-mgmt-ipv6-9407710a3fc7f4aa.yaml View File

@@ -0,0 +1,5 @@
---
fixes:
- |
Fixed an issue with the Dell EMC Unity driver to work with
a management IP configured in IPv6 format.

Loading…
Cancel
Save