]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Update host on driver retype
authorAvishay Traeger <avishay@il.ibm.com>
Sun, 12 Jan 2014 13:41:31 +0000 (15:41 +0200)
committerjohn-griffith <john.griffith@solidfire.com>
Sun, 19 Jan 2014 17:18:39 +0000 (10:18 -0700)
The volume's host was not updated on retype where the driver handled
the retype. Now update in all cases.

Change-Id: I64b72ae5617d1dacad8f37c4246ce0f079e015bb
Closes-Bug: #1268305

cinder/tests/test_volume.py
cinder/volume/manager.py

index 6eb542d7cb0f8f2555e742995e1f8a2d3bbd0876..3a5af17cd1cfd346b89fcea231dbc910b9d58bfc 100644 (file)
@@ -2220,10 +2220,12 @@ class VolumeTestCase(BaseVolumeTestCase):
         if not exc:
             self.assertEqual(volume['volume_type_id'], vol_type['id'])
             self.assertEqual(volume['status'], 'available')
+            self.assertEqual(volume['host'], 'newhost')
             self.assertEqual(volumes_in_use, 1)
         else:
             self.assertEqual(volume['volume_type_id'], old_vol_type['id'])
             self.assertEqual(volume['status'], 'available')
+            self.assertEqual(volume['host'], CONF.host)
             self.assertEqual(volumes_in_use, 0)
 
     def test_retype_volume_driver_success(self):
index 1da9d01f0fb2a430b83c30582d76958520c27c9b..7c8ef353b1b53e67ff22a76a78224e85f4bcce6b 100644 (file)
@@ -1215,6 +1215,7 @@ class VolumeManager(manager.SchedulerDependentManager):
 
         self.db.volume_update(context, volume_id,
                               {'volume_type_id': new_type_id,
+                               'host': host['host'],
                                'status': status_update['status']})
 
         if old_reservations: