]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Get full volume model in Replication manager API’s
authorPatrick East <patrick.east@purestorage.com>
Wed, 2 Sep 2015 20:51:42 +0000 (13:51 -0700)
committerPatrick East <patrick.east@purestorage.com>
Wed, 2 Sep 2015 20:59:27 +0000 (13:59 -0700)
Currently we pass in a dictionary of the volume properties, but not the
actual volume model. This dictionary is missing some of the properties
like ‘name’ which backends may required for volume operations.

Change-Id: Idcb7b2c8313360a77ba336f3b7534d8fa7431a41
Closes-Bug: #1491585

cinder/volume/manager.py

index 293777b0ef8ac24ba3667d44ae220cecaba1b700..8b413ae7a7f4297048f9828d577f405c87177f1b 100644 (file)
@@ -3058,6 +3058,7 @@ class VolumeManager(manager.SchedulerDependentManager):
         :param secondary: Specifies rep target to fail over to
         """
         try:
+            volume = self.db.volume_get(context, volume['id'])
             volume_updates = self.driver.replication_failover(context,
                                                               volume,
                                                               secondary)
@@ -3153,6 +3154,7 @@ class VolumeManager(manager.SchedulerDependentManager):
         """
 
         try:
+            volume = self.db.volume_get(context, volume['id'])
             replication_targets = self.driver.list_replication_targets(context,
                                                                        volume)