]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix Datera driver export call
authorMike Perez <thingee@gmail.com>
Sat, 20 Jun 2015 02:12:15 +0000 (19:12 -0700)
committerMike Perez <thingee@gmail.com>
Sat, 20 Jun 2015 02:30:22 +0000 (19:30 -0700)
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

cinder/tests/unit/volume/drivers/test_datera.py
cinder/volume/drivers/datera.py

index cb90de81864b13ae24b2f8d712243544ca6c342e..4f7901163af737116526c85af94aefc4f894203e 100644 (file)
@@ -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 = {
index 244f544b7716f6efd10302732223401983ff8746..2e969e16228f6950e87f13cf1a7482fa1d21c7dc 100644 (file)
@@ -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',