]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Pass correct args to vol_rpc create_volume calls
authorMike Perez <thingee@gmail.com>
Wed, 25 Sep 2013 03:55:04 +0000 (20:55 -0700)
committerMike Perez <thingee@gmail.com>
Wed, 25 Sep 2013 03:55:04 +0000 (20:55 -0700)
In the chance and simple scheduler, create volume was originally using
snapshot_id and image_id for request_spec and filter_properties. This
corrects that by passing the correct arguments and keyword arguments to
create_volume.

Change-Id: Icbcfbfb28f36e1f75519bf5ad6fcbcc12a9b4ec1
Closes-Bug: #1212710

cinder/scheduler/chance.py
cinder/scheduler/simple.py

index 0b9a4dac67d6ed8a608c0196c38fa29ce357cd14..0cc4e760a86dcc3d49396aebe25c36e8476b18a5 100644 (file)
@@ -76,7 +76,9 @@ class ChanceScheduler(driver.Scheduler):
 
         updated_volume = driver.volume_update_db(context, volume_id, host)
         self.volume_rpcapi.create_volume(context, updated_volume, host,
-                                         snapshot_id, image_id)
+                                         request_spec, filter_properties,
+                                         snapshot_id=snapshot_id,
+                                         image_id=image_id)
 
     def host_passes_filters(self, context, host, request_spec,
                             filter_properties):
index 5329d6fd7c60960ec393348b834b266ff7d5ef35..1ab48053e9ebe04c14effd387f5148dfa603e3ed 100644 (file)
@@ -62,11 +62,10 @@ class SimpleScheduler(chance.ChanceScheduler):
             if not utils.service_is_up(service):
                 raise exception.WillNotSchedule(host=host)
             updated_volume = driver.volume_update_db(context, volume_id, host)
-            self.volume_rpcapi.create_volume(context,
-                                             updated_volume,
-                                             host,
-                                             snapshot_id,
-                                             image_id)
+            self.volume_rpcapi.create_volume(context, updated_volume, host,
+                                             request_spec, filter_properties,
+                                             snapshot_id=snapshot_id,
+                                             image_id=image_id)
             return None
 
         results = db.service_get_all_volume_sorted(elevated)
@@ -81,11 +80,11 @@ class SimpleScheduler(chance.ChanceScheduler):
             if utils.service_is_up(service) and not service['disabled']:
                 updated_volume = driver.volume_update_db(context, volume_id,
                                                          service['host'])
-                self.volume_rpcapi.create_volume(context,
-                                                 updated_volume,
-                                                 service['host'],
-                                                 snapshot_id,
-                                                 image_id)
+                self.volume_rpcapi.create_volume(context, updated_volume,
+                                                 service['host'], request_spec,
+                                                 filter_properties,
+                                                 snapshot_id=snapshot_id,
+                                                 image_id=image_id)
                 return None
         msg = _("Is the appropriate service running?")
         raise exception.NoValidHost(reason=msg)