]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Handle attachment of second volume
authorPradeep Sathasivam <psathasi@brocade.com>
Mon, 29 Jun 2015 11:38:19 +0000 (17:08 +0530)
committerPradeep Sathasivam <psathasi@brocade.com>
Mon, 29 Jun 2015 12:12:25 +0000 (17:42 +0530)
When the zoning policy is initiator and a second volume is attached
to an instance, the current implementation deletes the existing zones
and then adds new zone data. While doing so, the configuration is deleted
and it is never added back.

The issue is due to delete/add design. When zones are deleted, active zone
set should also be updated, as based on active zone set config is either
created/updated. Added code to get active zone set before adding the zones.

Change-Id: Ib0cd51c3724142175eb1c602d6c1f87dd5e985fb
Closes-Bug: #1465207

cinder/tests/unit/zonemanager/test_brcd_fc_zone_client_cli.py
cinder/zonemanager/drivers/brocade/brcd_fc_zone_client_cli.py

index 46e67eb0ee02fcbbc48bf3a4049e7d9f6124d20c..0a55e4eb8aee8fe9bec0c1d84860c5e5a55ce03d 100644 (file)
@@ -94,7 +94,7 @@ class TestBrcdFCZoneClientCLI(client_cli.BrcdFCZoneClientCLI, test.TestCase):
                                             get_active_zs_mock):
         get_active_zs_mock.return_value = active_zoneset
         self.add_zones(new_zones, False, None)
-        get_active_zs_mock.assert_called_once_with()
+        self.assertEqual(2, get_active_zs_mock.call_count)
         self.assertEqual(3, apply_zone_change_mock.call_count)
         cfg_save_mock.assert_called_once_with()
 
index a1ad479349624f7f584a049f14d0b2cee66efd35..480fd03adf81d0f4119d09f077ec91dcb4c69125 100644 (file)
@@ -163,6 +163,9 @@ class BrcdFCZoneClientCLI(object):
             iterator_count += 1
             zone_with_sep += zone
         try:
+            # Get active zone set from device, as some of the zones
+            # could be deleted.
+            active_zone_set = self.get_active_zone_set()
             cfg_name = active_zone_set[ZoneConstant.ACTIVE_ZONE_CONFIG]
             cmd = None
             if not cfg_name: