]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix incorrect usage of get_flow in volume.manager
authorJohn Griffith <john.griffith@solidfire.com>
Fri, 9 Jan 2015 23:58:06 +0000 (23:58 +0000)
committerJohn Griffith <john.griffith@solidfire.com>
Fri, 9 Jan 2015 23:58:06 +0000 (23:58 +0000)
The call to flows.manager.create_volume.get_flow in cinder.volume.manager's
create_volume method is passing in keyword args where the flows manager is
actually expecting positional arguments. The good thing is that most of these
seem to evaluate to boolean values and are evaluated as True, so they don't
fail; however the behavior isn't going to be exactly as expected here.

The method signature in flows.manager.create_volume:

    def get_flow(context, db, driver, scheduler_rpcapi, host, volume_id,
             allow_reschedule, reschedule_context, request_spec,
             filter_properties, snapshot_id=None, image_id=None,
             source_volid=None, source_replicaid=None,
             consistencygroup_id=None):

Meanwhile the call in cinder.volume.manager.create_volume:

            flow_engine = create_volume.get_flow(
                context_elevated,
                self.db,
                self.driver,
                self.scheduler_rpcapi,
                self.host,
                volume_id,
                snapshot_id=snapshot_id,
                image_id=image_id,
                source_volid=source_volid,
                source_replicaid=source_replicaid,
                consistencygroup_id=consistencygroup_id,
                allow_reschedule=allow_reschedule,
                reschedule_context=context,
                request_spec=request_spec,
                filter_properties=filter_properties)

Change-Id: I0ec8c7e754521e418f534e199e58fa7e4ef01499
Closes-Bug: #1409168

cinder/volume/manager.py

index 6c51940098c9a8e8d93fe3733e2ed2191f6dd1c9..ae060b4e6c955ecafb199122f79c310ef11406d6 100644 (file)
@@ -363,15 +363,15 @@ class VolumeManager(manager.SchedulerDependentManager):
                 self.scheduler_rpcapi,
                 self.host,
                 volume_id,
+                allow_reschedule,
+                context,
+                request_spec,
+                filter_properties,
                 snapshot_id=snapshot_id,
                 image_id=image_id,
                 source_volid=source_volid,
                 source_replicaid=source_replicaid,
-                consistencygroup_id=consistencygroup_id,
-                allow_reschedule=allow_reschedule,
-                reschedule_context=context,
-                request_spec=request_spec,
-                filter_properties=filter_properties)
+                consistencygroup_id=consistencygroup_id)
         except Exception:
             LOG.exception(_LE("Failed to create manager volume flow"))
             raise exception.CinderException(