components/openstack/cinder/patches/04-volume-backup.patch
author Laszlo Peter <laszlo.peter@oracle.com>
Wed, 07 Sep 2016 14:48:41 -0700
changeset 6849 f9a2279efa0d
parent 5405 66fd59fecd68
permissions -rw-r--r--
24465600 Update Cinder for the Mitaka release

This patch is to replace Linux-specific code with conditional checks in
the Cinder Brick code to support Cinder backup on Solaris. Patch has
not yet been submitted upstream.

--- cinder-8.0.0/cinder/utils.py.~1~	2016-04-07 00:30:55.000000000 -0700
+++ cinder-8.0.0/cinder/utils.py	2016-06-10 14:39:00.866171230 -0700
@@ -143,8 +143,12 @@ def check_exclusive_options(**kwargs):
 
 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 '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)