From 8b5c36a8d0ffffeafc15a2f9ee18481fd910dc15 Mon Sep 17 00:00:00 2001 From: Mike Perez Date: Fri, 19 Jun 2015 19:12:15 -0700 Subject: [PATCH] Fix Datera driver export call A previous commit 3fabed9d64696a204263fd7e00b65115a8ecce87 broke the export call for the Datera driver. This allows the information to correctly be accessed again. Change-Id: I4775700e7a416bf5ebcb5e39f604b270e27f284d Closes-Bug: #1466967 --- .../tests/unit/volume/drivers/test_datera.py | 48 +++++++------------ cinder/volume/drivers/datera.py | 7 +-- 2 files changed, 19 insertions(+), 36 deletions(-) diff --git a/cinder/tests/unit/volume/drivers/test_datera.py b/cinder/tests/unit/volume/drivers/test_datera.py index cb90de818..4f7901163 100644 --- a/cinder/tests/unit/volume/drivers/test_datera.py +++ b/cinder/tests/unit/volume/drivers/test_datera.py @@ -328,35 +328,18 @@ class DateraVolumeTestCase(test.TestCase): stub_create_export = { u'_ipColl': [u'172.28.121.10', u'172.28.120.10'], - u'acls': {}, - u'activeServers': {u'4594953e-f97f-e111-ad85-001e6738c0f0': u'1'}, - u'ctype': u'TC_BLOCK_ISCSI', - u'endpointsExt1': { - u'4594953e-f97f-e111-ad85-001e6738c0f0': { - u'ipHigh': 0, - u'ipLow': u'192421036', - u'ipStr': u'172.28.120.11', - u'ipV': 4, - u'name': u'', - u'network': 24 - } - }, - u'endpointsExt2': { - u'4594953e-f97f-e111-ad85-001e6738c0f0': { - u'ipHigh': 0, - u'ipLow': u'192486572', - u'ipStr': u'172.28.121.11', - u'ipV': 4, - u'name': u'', - u'network': 24 - } - }, - u'inodes': {u'c20aba21-6ef6-446b-b374-45733b4883ba': u'1'}, - u'name': u'', - u'networkPort': 0, - u'serverAllocation': u'TS_ALLOC_COMPLETED', - u'servers': {u'4594953e-f97f-e111-ad85-001e6738c0f0': u'1'}, - u'targetAllocation': u'TS_ALLOC_COMPLETED', + u'active_initiators': [], + u'activeServers': [u'4594953e-f97f-e111-ad85-001e6738c0f0'], + u'admin_state': u'online', + u'atype': u'none', + u'creation_type': u'system_explicit', + u'endpoint_addrs': [u'172.30.128.2'], + u'endpoint_idents': [u'iqn.2013-05.com.daterainc::01:sn:fc372bc0490b2dbe'], + u'initiators': [], + u'name': u'OS-a8b4d666', + u'server_allocation': u'TS_ALLOC_COMPLETED', + + u'servers': [u'4594953e-f97f-e111-ad85-001e6738c0f0'], u'targetIds': { u'4594953e-f97f-e111-ad85-001e6738c0f0': { u'ids': [{ @@ -365,8 +348,11 @@ stub_create_export = { }] } }, - u'typeName': u'TargetIscsiConfig', - u'uuid': u'7071efd7-9f22-4996-8f68-47e9ab19d0fd' + + u'target_allocation': u'TS_ALLOC_COMPLETED', + u'type': u'iscsi', + u'uuid': u'7071efd7-9f22-4996-8f68-47e9ab19d0fd', + u'volumes': [] } stub_get_export = { diff --git a/cinder/volume/drivers/datera.py b/cinder/volume/drivers/datera.py index 244f544b7..2e969e162 100644 --- a/cinder/volume/drivers/datera.py +++ b/cinder/volume/drivers/datera.py @@ -177,12 +177,9 @@ class DateraDriver(san.SanISCSIDriver): 'volumes', action='export', method='post', body={'ctype': 'TC_BLOCK_ISCSI'}, resource=volume['id']) - portal = "%s:3260" % export['_ipColl'][0] + portal = "%s:3260" % export['endpoint_addrs'][0] - # NOTE(thingee): Refer to the Datera test for a stub of what this - # looks like. We're just going to pull the first IP that the Datera - # cluster makes available for the portal. - iqn = next(export['targetIds'].values())['ids'][0]['id'] + iqn = export['endpoint_idents'][0] else: export = self._issue_api_request( 'export_configs', -- 2.45.2