]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Return a tuple from SolidFire update_provider_info
authorJohn Griffith <john.griffith8@gmail.com>
Tue, 8 Sep 2015 21:29:05 +0000 (15:29 -0600)
committerJohn Griffith <john.griffith8@gmail.com>
Tue, 8 Sep 2015 21:29:05 +0000 (15:29 -0600)
The SolidFire update_provider_info is only returning
a list of updated volumes, but the manager call (and
the method def in the reference) calls for a tuple of
volumes and snapshots.

This patch fixes the return to be a tuple, a follow on
will be needed to add snapshot updates.

Change-Id: Ifa617bfd7b0652adf7bf1b19d48e88bfcfcec8df
Partial-Bug: #1493563

cinder/tests/unit/test_solidfire.py
cinder/volume/drivers/solidfire.py

index a3a4b2d7af474d147b3544e7ab0f887b9c2d22bb..5210e0846d874fad67ae1063a0c54b03ce882758 100644 (file)
@@ -1046,6 +1046,6 @@ class SolidFireVolumeTestCase(test.TestCase):
 
         with mock.patch.object(
                 sfv, '_issue_api_request', side_effect=_fake_issue_api_req):
-            updates = sfv._init_volume_mappings(vrefs)
-            self.assertEqual(99, updates[0]['provider_id'])
-            self.assertEqual(1, len(updates))
+            volume_updates, snapshot_updates = sfv.update_provider_info(vrefs)
+            self.assertEqual(99, volume_updates[0]['provider_id'])
+            self.assertEqual(1, len(volume_updates))
index 48cdfb89d6670c7be394f211c5509fa057fb1070..f662c382612946c5c60c03bdad3ab8b697381e59 100644 (file)
@@ -205,7 +205,9 @@ class SolidFireDriver(san.SanISCSIDriver):
         return updates
 
     def update_provider_info(self, vrefs):
-        return self._init_volume_mappings(vrefs)
+        volume_updates = self._init_volume_mappings(vrefs)
+        snapshot_updates = None
+        return (volume_updates, snapshot_updates)
 
     def _create_template_account(self, account_name):
         # We raise an API exception if the account doesn't exist