]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Removed need for domain in 3PAR drivers
authorKurt Martin <kurt.f.martin@hp.com>
Mon, 19 Aug 2013 18:14:42 +0000 (11:14 -0700)
committerKurt Martin <kurt.f.martin@hp.com>
Mon, 19 Aug 2013 18:14:42 +0000 (11:14 -0700)
The 3PAR drivers need to support CPGs that are not part of a
virtual domain on the 3PAR backend. This patch removes the need
for the CPG to be part of a domain and changes a few of the commands
that took the domain as an option.

DocImpact

Change-Id: I7e472e19e484e837c9216ea01455a4b8a85b19e5
Fixes: bug #1212328
cinder/volume/drivers/san/hp/hp_3par_common.py
cinder/volume/drivers/san/hp/hp_3par_fc.py
cinder/volume/drivers/san/hp/hp_3par_iscsi.py

index 20235800b2c7697b6f9533d4c60d9213ecbbe89d..9cce016bcb3138ada6892e95339aa8300e46ced7 100644 (file)
@@ -199,12 +199,9 @@ class HP3PARCommon(object):
             LOG.error(err)
             raise exception.InvalidInput(reason=err)
 
-        domain = cpg['domain']
-        if not domain:
-            err = (_("CPG (%s) must be in a domain") % cpg_name)
-            LOG.error(err)
-            raise exception.InvalidInput(reason=err)
-        return domain
+        if 'domain' in cpg:
+            return cpg['domain']
+        return None
 
     def extend_volume(self, volume, new_size):
         volume_name = self._get_3par_vol_name(volume['id'])
index 521a88c474a901c547b91e40e7a261ababa3e9dc..300c9668022197af1968e70f5624af2fb7dc57e6 100644 (file)
@@ -205,8 +205,11 @@ class HP3PARFCDriver(cinder.volume.driver.FibreChannelDriver):
         the same wwn but with a different hostname, return the hostname
         used by 3PAR.
         """
-        command = ['createhost', '-persona', persona_id, '-domain', domain,
-                   hostname]
+        if domain is not None:
+            command = ['createhost', '-persona', persona_id, '-domain', domain,
+                       hostname]
+        else:
+            command = ['createhost', '-persona', persona_id, hostname]
         for wwn in wwns:
             command.append(wwn)
 
index f542227f020c3053e7f0b392b0c6752ec30f64fb..94670299e4c72058de0a10f4462120d7fe57ab7b 100644 (file)
@@ -264,8 +264,12 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver):
         the same iqn but with a different hostname, return the hostname
         used by 3PAR.
         """
-        cmd = ['createhost', '-iscsi', '-persona', persona_id, '-domain',
-               domain, hostname, iscsi_iqn]
+        if domain is not None:
+            cmd = ['createhost', '-iscsi', '-persona', persona_id, '-domain',
+                   domain, hostname, iscsi_iqn]
+        else:
+            cmd = ['createhost', '-iscsi', '-persona', persona_id, hostname,
+                   iscsi_iqn]
         out = self.common._cli_run(cmd)
         if out and len(out) > 1:
             return self.common.parse_create_host_error(hostname, out)