]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fixup stats key for replication in init_host_with_pc
authorPatrick East <patrick.east@purestorage.com>
Fri, 11 Mar 2016 23:28:27 +0000 (15:28 -0800)
committerPatrick East <patrick.east@purestorage.com>
Fri, 11 Mar 2016 23:28:27 +0000 (15:28 -0800)
We were looking for just ‘replication’ in stats, but that key isn’t
used by anyone and would always be false. We instead want to be keying
off of just replication_enabled.

Change-Id: I8f4ef8d5c6594c1548958ebac2ff63b79429cd0b
Closes-Bug: #1556315

cinder/volume/manager.py

index ff89cf757e58d2f65b5a2d9faef369749c830ca9..102fcdbf45c2d50799cf3a00751fd068de99e89d 100644 (file)
@@ -530,14 +530,12 @@ class VolumeManager(manager.SchedulerDependentManager):
                 LOG.error(_LE("Service not found for updating "
                               "replication_status."))
 
-        if stats and stats.get('replication', False):
-            if service.replication_status == (
-                    fields.ReplicationStatus.FAILED_OVER):
-                pass
-            elif stats and stats.get('replication_enabled', False):
+        if service.replication_status != (
+                fields.ReplicationStatus.FAILED_OVER):
+            if stats and stats.get('replication_enabled', False):
                 service.replication_status = fields.ReplicationStatus.ENABLED
-        else:
-            service.replication_status = fields.ReplicationStatus.DISABLED
+            else:
+                service.replication_status = fields.ReplicationStatus.DISABLED
 
         service.save()
         LOG.info(_LI("Driver post RPC initialization completed successfully."),