components/openstack/cinder/patches/03-emc_smis_iscsi.patch
changeset 3998 5bd484384122
parent 3997 0ca3f3d6c919
child 4002 95b8f35fcdd5
--- a/components/openstack/cinder/patches/03-emc_smis_iscsi.patch	Fri Mar 20 03:13:26 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-In-house patch to adopt EMC driver to use Solaris' iscsiadm(1M) rather
-than that from Linux.  Patch has not yet been submitted upstream.
-
---- cinder-2013.2.3/cinder/volume/drivers/emc/emc_smis_iscsi.py.~1~	2014-04-03 11:42:36.000000000 -0700
-+++ cinder-2013.2.3/cinder/volume/drivers/emc/emc_smis_iscsi.py	2014-04-09 01:30:22.894010750 -0700
-@@ -21,6 +21,8 @@
- """
- 
- 
-+import sys
-+
- from cinder import exception
- from cinder.openstack.common import log as logging
- from cinder.volume import driver
-@@ -114,13 +116,41 @@
- 
-         LOG.warn(_("ISCSI provider_location not stored, using discovery"))
- 
--        (out, _err) = self._execute('iscsiadm', '-m', 'discovery',
--                                    '-t', 'sendtargets', '-p',
--                                    self.configuration.iscsi_ip_address,
--                                    run_as_root=True)
-         targets = []
--        for target in out.splitlines():
--            targets.append(target)
-+
-+        if sys.platform == 'sunos5':
-+            data = _("Unexpected response while retrieving discovery-address "
-+                     "objects for volume '%s'") % volume["name"]
-+
-+            self._execute('/usr/sbin/iscsiadm', 'add', 'discovery-address',
-+                          self.configuration.iscsi_ip_address)
-+            (out, _err) = self._execute('/usr/sbin/iscsiadm', 'list',
-+                                        'discovery-address', '-v',
-+                                        self.configuration.iscsi_ip_address)
-+            lines = out.splitlines()
-+            if not lines[0].strip().startswith('Discovery Address: '):
-+                raise exception.VolumeBackendAPIException(data=data)
-+
-+            for i in range(1, len(lines), 2):
-+                name = lines[i].strip()
-+                if not name.startswith('Target name: '):
-+                    raise exception.VolumeBackendAPIException(data=data)
-+                (_, _, name) = name.split()
-+
-+                address = lines[i + 1].strip()
-+                if not address.startswith('Target address: '):
-+                    raise exception.VolumeBackendAPIException(data=data)
-+                (_, _, address, tpgt) = address.split()
-+                target = address + tpgt + ' ' + name
-+                targets.append(target)
-+
-+        else:
-+            (out, _err) = self._execute('iscsiadm', '-m', 'discovery',
-+                                        '-t', 'sendtargets', '-p',
-+                                        self.configuration.iscsi_ip_address,
-+                                        run_as_root=True)
-+            for target in out.splitlines():
-+                targets.append(target)
- 
-         return targets
-