|
1 Based on patch from https://review.openstack.org/#/c/336598/ |
|
2 Modified for Kilo (dropped test code) |
|
3 |
|
4 From bc2f011fc0fd7e8ad331b3ae1918a5f660691253 Mon Sep 17 00:00:00 2001 |
|
5 From: Kedar Vidvans <[email protected]> |
|
6 Date: Fri, 1 Jul 2016 10:29:09 -0400 |
|
7 Subject: Fixes ZFSSANFS driver on Solaris platform |
|
8 |
|
9 The Solaris operating system doesn't have the mount.nfs |
|
10 tool installed. This fix skips the check for mount.nfs |
|
11 if the operating system is Solaris in the setup method. |
|
12 |
|
13 Change-Id: I8f6ee8e576a0f79ffe688aa2740913e9097e06c0 |
|
14 Closes-Bug: #1598191 |
|
15 |
|
16 --- cinder-2015.1.2/cinder/volume/drivers/zfssa/zfssanfs.py.orig |
|
17 +++ cinder-2015.1.2/cinder/volume/drivers/zfssa/zfssanfs.py |
|
18 @@ -89,15 +89,18 @@ |
|
19 LOG.error(msg) |
|
20 raise exception.NfsException(msg) |
|
21 |
|
22 - package = 'mount.nfs' |
|
23 - try: |
|
24 - self._execute(package, check_exit_code=False, run_as_root=True) |
|
25 - except OSError as exc: |
|
26 - if exc.errno == errno.ENOENT: |
|
27 - msg = _('%s is not installed') % package |
|
28 - raise exception.NfsException(msg) |
|
29 - else: |
|
30 - raise exc |
|
31 + packages = ('mount.nfs', '/usr/sbin/mount') |
|
32 + for package in packages: |
|
33 + try: |
|
34 + self._execute(package, check_exit_code=False, run_as_root=True) |
|
35 + break |
|
36 + except OSError as exc: |
|
37 + if exc.errno != errno.ENOENT: |
|
38 + raise |
|
39 + LOG.error(_LE('%s is not installed.'), package) |
|
40 + else: |
|
41 + msg = utils.build_or_str(packages, '%s needs to be installed.') |
|
42 + raise exception.NfsException(msg) |
|
43 |
|
44 lcfg = self.configuration |
|
45 LOG.info(_LI('Connecting to host: %s.'), lcfg.san_ip) |