]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix volume_rpcapi calls for chance/simple scheds
authorAvishay Traeger <avishay@il.ibm.com>
Mon, 23 Sep 2013 18:18:56 +0000 (21:18 +0300)
committerAvishay Traeger <avishay@il.ibm.com>
Tue, 24 Sep 2013 05:58:28 +0000 (08:58 +0300)
Change the chance and simple schedulers to pass the snapshot_id and
image_id parameters correctly volume_rpcapi, so that their values reach
cinder-volume.

Change-Id: I0abbca1fa0445c5233387a0f17363fc092d39b88
Closes-Bug: #1212710

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

index 0b9a4dac67d6ed8a608c0196c38fa29ce357cd14..d2c563e5671475fdf0f0abec3d932e63b0778486 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)
+                                         allow_reschedule=False,
+                                         snapshot_id=snapshot_id,
+                                         image_id=image_id)
 
     def host_passes_filters(self, context, host, request_spec,
                             filter_properties):
index 5329d6fd7c60960ec393348b834b266ff7d5ef35..d131e63feafb2e599dc5fa7085bf3539a28b6aba 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,
+                                             allow_reschedule=False,
+                                             snapshot_id=snapshot_id,
+                                             image_id=image_id)
             return None
 
         results = db.service_get_all_volume_sorted(elevated)
@@ -84,8 +83,9 @@ class SimpleScheduler(chance.ChanceScheduler):
                 self.volume_rpcapi.create_volume(context,
                                                  updated_volume,
                                                  service['host'],
-                                                 snapshot_id,
-                                                 image_id)
+                                                 allow_reschedule=False,
+                                                 snapshot_id=snapshot_id,
+                                                 image_id=image_id)
                 return None
         msg = _("Is the appropriate service running?")
         raise exception.NoValidHost(reason=msg)