--- a/components/openstack/cinder/patches/04-volume-backup.patch Fri Oct 09 09:55:13 2015 -0700
+++ b/components/openstack/cinder/patches/04-volume-backup.patch Fri Oct 09 11:54:18 2015 -0700
@@ -1,8 +1,8 @@
This patch is to replace the linux-specific codes with the solaris
codes to support the cinder backup on the Solaris.
---- cinder-2014.2.2/cinder/brick/initiator/connector.py.~1~ 2014-10-16 06:26:26.000000000 -0700
-+++ cinder-2014.2.2/cinder/brick/initiator/connector.py 2015-01-04 23:12:23.661116812 -0800
+--- cinder-2014.2.2/cinder/brick/initiator/connector.py.~1~ 2015-02-05 08:03:26.000000000 -0800
++++ cinder-2014.2.2/cinder/brick/initiator/connector.py 2015-04-20 21:05:25.881159722 -0700
@@ -15,6 +15,7 @@
import os
@@ -58,7 +58,16 @@
super(ISCSIConnector, self).__init__(root_helper, driver=driver,
execute=execute,
device_scan_attempts=
-@@ -192,6 +204,9 @@
+@@ -181,6 +193,8 @@
+
+ def set_execute(self, execute):
+ super(ISCSIConnector, self).set_execute(execute)
++ if sys.platform == 'sunos5':
++ return
+ self._linuxscsi.set_execute(execute)
+
+ @synchronized('connect_volume')
+@@ -192,6 +206,9 @@
target_iqn - iSCSI Qualified Name
target_lun - LUN id of the volume
"""
@@ -68,18 +77,17 @@
device_info = {'type': 'block'}
-@@ -262,6 +277,10 @@
+@@ -262,6 +279,9 @@
target_iqn - iSCSI Qualified Name
target_lun - LUN id of the volume
"""
+ if sys.platform == 'sunos5':
-+ self._solarisiscsi.disconnect_iscsi()
+ return
+
# Moved _rescan_iscsi and _rescan_multipath
# from _disconnect_volume_multipath_iscsi to here.
# Otherwise, if we do rescan after _linuxscsi.remove_multipath_device
-@@ -306,6 +325,9 @@
+@@ -306,6 +326,9 @@
def get_initiator(self):
"""Secure helper to read file as root."""
@@ -89,7 +97,7 @@
file_path = '/etc/iscsi/initiatorname.iscsi'
try:
lines, _err = self._execute('cat', file_path, run_as_root=True,
-@@ -555,8 +577,11 @@
+@@ -555,8 +578,11 @@
execute=putils.execute, use_multipath=False,
device_scan_attempts=DEVICE_SCAN_ATTEMPTS_DEFAULT,
*args, **kwargs):
@@ -103,7 +111,16 @@
super(FibreChannelConnector, self).__init__(root_helper, driver=driver,
execute=execute,
device_scan_attempts=
-@@ -578,6 +603,10 @@
+@@ -566,6 +592,8 @@
+
+ def set_execute(self, execute):
+ super(FibreChannelConnector, self).set_execute(execute)
++ if sys.platform == 'sunos5':
++ return
+ self._linuxscsi.set_execute(execute)
+ self._linuxfc.set_execute(execute)
+
+@@ -578,6 +606,10 @@
target_iqn - iSCSI Qualified Name
target_lun - LUN id of the volume
"""
@@ -114,7 +131,7 @@
LOG.debug("execute = %s" % self._execute)
device_info = {'type': 'block'}
-@@ -686,6 +715,13 @@
+@@ -686,6 +718,13 @@
target_wwn - iSCSI Qualified Name
target_lun - LUN id of the volume
"""
@@ -130,15 +147,18 @@
# If this is a multipath device, we need to search again
---- cinder-2014.2.2/cinder/utils.py.~1~ 2014-10-16 06:26:26.000000000 -0700
-+++ cinder-2014.2.2/cinder/utils.py 2015-01-04 23:26:04.305688145 -0800
-@@ -137,8 +137,9 @@
+--- cinder-2014.2.2/cinder/utils.py.~1~ 2015-02-05 08:03:26.000000000 -0800
++++ cinder-2014.2.2/cinder/utils.py 2015-04-20 20:46:27.658908715 -0700
+@@ -137,8 +137,12 @@
def execute(*cmd, **kwargs):
"""Convenience wrapper around oslo's execute() method."""
- if 'run_as_root' in kwargs and 'root_helper' not in kwargs:
- kwargs['root_helper'] = get_root_helper()
-+ if sys.platform != 'sunos5':
++ if sys.platform == 'sunos5':
++ if 'run_as_root' in kwargs:
++ kwargs['run_as_root'] = False
++ else:
+ if 'run_as_root' in kwargs and 'root_helper' not in kwargs:
+ kwargs['root_helper'] = get_root_helper()
return processutils.execute(*cmd, **kwargs)