]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix FakeISCSIDriver and FakeISERDriver
authorIvan Kolodyazhny <e0ne@e0ne.info>
Fri, 8 May 2015 14:00:04 +0000 (17:00 +0300)
committerIvan Kolodyazhny <e0ne@e0ne.info>
Fri, 8 May 2015 14:02:25 +0000 (17:02 +0300)
Need to pass correct int value for provisioned_capacity_gb capability
to get it working with scheduler.

Change-Id: Iee93f11d12e035d89227c5ffaf336ee2dcd1bcec
Closes-Bug: #1453146

cinder/volume/driver.py

index b9dfea00f024f2ef22fc13e8be7d97845bfc60f9..0b76a01b0df8c22f2e0300fa136d6e793e4fdfda 100644 (file)
@@ -1636,6 +1636,21 @@ class FakeISCSIDriver(ISCSIDriver):
         super(FakeISCSIDriver, self).__init__(execute=self.fake_execute,
                                               *args, **kwargs)
 
+    def _update_pools_and_stats(self, data):
+        fake_pool = {}
+        fake_pool.update(dict(
+            pool_name=data["volume_backend_name"],
+            total_capacity_gb=0,
+            free_capacity_gb=0,
+            provisioned_capacity_gb=0,
+            reserved_percentage=100,
+            QoS_support=False,
+            filter_function=self.get_filter_function(),
+            goodness_function=self.get_goodness_function()
+        ))
+        data["pools"].append(fake_pool)
+        self._stats = data
+
     def create_volume(self, volume):
         pass