components/openstack/cinder/patches/09-nfs-mount.patch
changeset 6849 f9a2279efa0d
parent 5405 66fd59fecd68
--- a/components/openstack/cinder/patches/09-nfs-mount.patch	Wed Sep 07 14:48:41 2016 -0700
+++ b/components/openstack/cinder/patches/09-nfs-mount.patch	Wed Sep 07 14:48:41 2016 -0700
@@ -3,8 +3,8 @@
 
 Patch may be suitable for pushing upsteam.
 
---- cinder-2014.2.2/cinder/volume/drivers/nfs.py.orig	2015-10-12 16:43:35.188157478 -0700
-+++ cinder-2014.2.2/cinder/volume/drivers/nfs.py	2015-10-13 09:35:07.871595794 -0700
+--- cinder-a99d1658a55f818a7e136d48d44d893406eae3e1/cinder/volume/drivers/nfs.py.~9~	2016-02-18 02:41:52.000000000 -0800
++++ cinder-a99d1658a55f818a7e136d48d44d893406eae3e1/cinder/volume/drivers/nfs.py	2016-02-18 03:23:26.380963052 -0800
 @@ -15,6 +15,7 @@
  
  import errno
@@ -12,8 +12,8 @@
 +import platform
  import time
  
- from oslo_concurrency import processutils as putils
-@@ -86,7 +87,10 @@ class NfsDriver(remotefs.RemoteFSDriver)
+ from os_brick.remotefs import remotefs as remotefs_brick
+@@ -78,7 +79,10 @@ class NfsDriver(driver.ExtendVD, remotef
          self._remotefsclient = None
          super(NfsDriver, self).__init__(*args, **kwargs)
          self.configuration.append_config_values(nfs_opts)
@@ -25,35 +25,37 @@
          # base bound to instance is used in RemoteFsConnector.
          self.base = getattr(self.configuration,
                              'nfs_mount_point_base',
-@@ -144,18 +148,19 @@ class NfsDriver(remotefs.RemoteFSDriver)
+@@ -123,19 +127,20 @@ class NfsDriver(driver.ExtendVD, remotef
  
          self.shares = {}  # address : options
  
--        # Check if mount.nfs is installed on this system; note that we don't
--        # need to be root to see if the package is installed.
+-        # Check if mount.nfs is installed on this system; note that we
+-        # need to be root, to also find mount.nfs on distributions, where
+-        # it is not located in an unprivileged users PATH (e.g. /sbin).
 -        package = 'mount.nfs'
 -        try:
 -            self._execute(package, check_exit_code=False,
--                          run_as_root=False)
+-                          run_as_root=True)
 -        except OSError as exc:
 -            if exc.errno == errno.ENOENT:
 -                msg = _('%s is not installed') % package
 -                raise exception.NfsException(msg)
 -            else:
--                raise exc
+-                raise
 +        if platform.system() != "SunOS":
-+            # Check if mount.nfs is installed on this system; note that we don't
-+            # need to be root to see if the package is installed.
++            # Check if mount.nfs is installed on this system; note that we
++            # need to be root, to also find mount.nfs on distributions, where
++            # it is not located in an unprivileged users PATH (e.g. /sbin).
 +            package = 'mount.nfs'
 +            try:
 +                self._execute(package, check_exit_code=False,
-+                              run_as_root=False)
++                              run_as_root=True)
 +            except OSError as exc:
 +                if exc.errno == errno.ENOENT:
 +                    msg = _('%s is not installed') % package
 +                    raise exception.NfsException(msg)
 +                else:
-+                    raise exc
++                    raise
  
          # Now that all configuration data has been loaded (shares),
          # we can "set" our final NAS file security options.