Merge "Check replication status failed for non-replication"

This commit is contained in:
Jenkins 2014-09-17 17:07:36 +00:00 committed by Gerrit Code Review
commit e715de39ac
2 changed files with 13 additions and 1 deletions

View File

@ -2796,6 +2796,15 @@ class StorwizeSVCDriverTestCase(test.TestCase):
self.assertEqual(term_data, term_ret)
def test_storwize_create_volume_with_replication_disable(self):
volume = self._generate_vol_info(None, None)
model_update = self.driver.create_volume(volume)
self.assertIsNone(model_update)
model_update = self.driver.get_replication_status(self.ctxt, volume)
self.assertIsNone(model_update)
def test_storwize_create_volume_with_strech_cluster_replication(self):
# Set replication flag, set pool openstack2 for secondary volume.
self._set_flag('storwize_svc_stretched_cluster_partner', 'openstack2')

View File

@ -753,7 +753,10 @@ class StorwizeSVCDriver(san.SanDriver):
return replica_status
def get_replication_status(self, ctxt, volume):
return self.replication.get_replication_status(volume)
replica_status = None
if self.replication:
replica_status = self.replication.get_replication_status(volume)
return replica_status
def _check_volume_copy_ops(self):
LOG.debug("enter: update volume copy status")