]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Storwize/SVC: Use reserved percentage from conf.
authorAvishay Traeger <avishay@il.ibm.com>
Wed, 31 Jul 2013 09:27:21 +0000 (12:27 +0300)
committerAvishay Traeger <avishay@il.ibm.com>
Wed, 31 Jul 2013 09:27:21 +0000 (12:27 +0300)
For reserved_percentage, use the value from the configuration file
instead of 0.

Change-Id: I549822c09449f8d9fc0c8b84d56660c381bddbd5

cinder/tests/test_storwize_svc.py
cinder/volume/drivers/storwize_svc.py

index 02b1b59b2a2f045abcc3f3f136db99fff78d7ca5..ea2f2729103086f9c32351f23b2894bb2cf490c1 100644 (file)
@@ -1949,9 +1949,11 @@ class StorwizeSVCDriverTestCase(test.TestCase):
             self.fail('%s not less than or equal to %s' % (repr(a), repr(b)))
 
     def test_storwize_svc_get_volume_stats(self):
+        self._set_flag('reserved_percentage', 25)
         stats = self.driver.get_volume_stats()
         self.assertLessEqual(stats['free_capacity_gb'],
                              stats['total_capacity_gb'])
+        self.assertEquals(stats['reserved_percentage'], 25)
         if self.USESIM:
             self.assertEqual(stats['volume_backend_name'],
                              'storwize-svc-sim_volpool')
index 85ad8fbec1ed8ec8b24cc0d404d989fc04b36d5c..8f803975edd68531e21021a7e6a1ebf8c5f370bc 100755 (executable)
@@ -1371,7 +1371,7 @@ class StorwizeSVCDriver(san.SanDriver):
 
         data['total_capacity_gb'] = 0  # To be overwritten
         data['free_capacity_gb'] = 0   # To be overwritten
-        data['reserved_percentage'] = 0
+        data['reserved_percentage'] = self.configuration.reserved_percentage
         data['QoS_support'] = False
 
         pool = self.configuration.storwize_svc_volpool_name