View | Details | Raw Unified | Return to bug 232245 | Differences between
and this patch

Collapse All | Expand All

(-)py-cinder/Makefile (-75 / +97 lines)
Lines 2-11 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	cinder
4
PORTNAME=	cinder
5
PORTVERSION=	9.1.1
5
PORTVERSION=	12.0.4
6
PORTREVISION=	1
7
CATEGORIES=	misc python
6
CATEGORIES=	misc python
8
MASTER_SITES=	https://fossies.org/linux/misc/openstack/
7
MASTER_SITES=	https://tarballs.openstack.org/cinder/
9
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
8
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
10
9
11
MAINTAINER=	alexander.nusov@nfvexpress.com
10
MAINTAINER=	alexander.nusov@nfvexpress.com
Lines 12-106 Link Here
12
COMMENT=	OpenStack Storage Service (Cinder)
11
COMMENT=	OpenStack Storage Service (Cinder)
13
12
14
LICENSE=	APACHE20
13
LICENSE=	APACHE20
14
LICENSE_FILE=	${WRKSRC}/LICENSE
15
15
16
BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pbr>=1.6:devel/py-pbr@${PY_FLAVOR}
16
BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pbr>=2.0.0:devel/py-pbr@${PY_FLAVOR}
17
RUN_DEPENDS:=	${BUILD_DEPENDS}
17
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pbr>=2.0.0:devel/py-pbr@${PY_FLAVOR} \
18
RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}Babel>=2.3.4:devel/py-babel@${PY_FLAVOR} \
18
		${PYTHON_PKGNAMEPREFIX}Babel>=2.3.4:devel/py-babel@${PY_FLAVOR} \
19
		${PYTHON_PKGNAMEPREFIX}decorator>=3.4.0:devel/py-decorator@${PY_FLAVOR} \
19
		${PYTHON_PKGNAMEPREFIX}decorator>=3.4.0:devel/py-decorator@${PY_FLAVOR} \
20
		${PY_ENUM34} \
20
		${PYTHON_PKGNAMEPREFIX}defusedxml>=0.5.0:devel/py-defusedxml@${PY_FLAVOR} \
21
		${PYTHON_PKGNAMEPREFIX}eventlet>=0:net/py-eventlet@${PY_FLAVOR} \
21
		${PYTHON_PKGNAMEPREFIX}eventlet>=0.18.2:net/py-eventlet@${PY_FLAVOR} \
22
		${PYTHON_PKGNAMEPREFIX}greenlet>=0.3.2:devel/py-greenlet@${PY_FLAVOR} \
22
		${PYTHON_PKGNAMEPREFIX}greenlet>=0.4.10:devel/py-greenlet@${PY_FLAVOR} \
23
		${PYTHON_PKGNAMEPREFIX}httplib2>=0.7.5:www/py-httplib2@${PY_FLAVOR} \
23
		${PYTHON_PKGNAMEPREFIX}httplib2>=0.9.1:www/py-httplib2@${PY_FLAVOR} \
24
		${PYTHON_PKGNAMEPREFIX}iso8601>=0.1.11:devel/py-iso8601@${PY_FLAVOR} \
24
		${PYTHON_PKGNAMEPREFIX}iso8601>=0.1.11:devel/py-iso8601@${PY_FLAVOR} \
25
		${PY_IPADDRESS} \
25
		${PYTHON_PKGNAMEPREFIX}jsonschema>=2.6.0:devel/py-jsonschema@${PY_FLAVOR} \
26
		${PYTHON_PKGNAMEPREFIX}keystoneauth1>=2.10.0:devel/py-keystoneauth1@${PY_FLAVOR} \
26
		${PYTHON_PKGNAMEPREFIX}keystoneauth1>=3.3.0:devel/py-keystoneauth1@${PY_FLAVOR} \
27
		${PYTHON_PKGNAMEPREFIX}keystonemiddleware>=0:devel/py-keystonemiddleware@${PY_FLAVOR} \
27
		${PYTHON_PKGNAMEPREFIX}keystonemiddleware>=4.17.0:devel/py-keystonemiddleware@${PY_FLAVOR} \
28
		${PYTHON_PKGNAMEPREFIX}lxml>=2.3:devel/py-lxml@${PY_FLAVOR} \
28
		${PYTHON_PKGNAMEPREFIX}lxml>=3.4.1:devel/py-lxml@${PY_FLAVOR} \
29
		${PYTHON_PKGNAMEPREFIX}oauth2client>=1.5.0:security/py-oauth2client@${PY_FLAVOR} \
29
		${PYTHON_PKGNAMEPREFIX}oauth2client>=1.5.0:security/py-oauth2client@${PY_FLAVOR} \
30
		${PYTHON_PKGNAMEPREFIX}oslo.config>=3.14.0:devel/py-oslo.config@${PY_FLAVOR} \
30
		${PYTHON_PKGNAMEPREFIX}oslo.config>=5.1.0:devel/py-oslo.config@${PY_FLAVOR} \
31
		${PYTHON_PKGNAMEPREFIX}oslo.concurrency>=3.8.0:devel/py-oslo.concurrency@${PY_FLAVOR} \
31
		${PYTHON_PKGNAMEPREFIX}oslo.concurrency>=3.25.0:devel/py-oslo.concurrency@${PY_FLAVOR} \
32
		${PYTHON_PKGNAMEPREFIX}oslo.context>=2.9.0:devel/py-oslo.context@${PY_FLAVOR} \
32
		${PYTHON_PKGNAMEPREFIX}oslo.context>=2.19.2:devel/py-oslo.context@${PY_FLAVOR} \
33
		${PYTHON_PKGNAMEPREFIX}oslo.db>=0:devel/py-oslo.db@${PY_FLAVOR} \
33
		${PYTHON_PKGNAMEPREFIX}oslo.db>=4.27.0:devel/py-oslo.db@${PY_FLAVOR} \
34
		${PYTHON_PKGNAMEPREFIX}oslo.log>=1.14.0:devel/py-oslo.log@${PY_FLAVOR} \
34
		${PYTHON_PKGNAMEPREFIX}oslo.log>=3.36.0:devel/py-oslo.log@${PY_FLAVOR} \
35
		${PYTHON_PKGNAMEPREFIX}oslo.messaging>=5.2.0:devel/py-oslo.messaging@${PY_FLAVOR} \
35
		${PYTHON_PKGNAMEPREFIX}oslo.messaging>=5.29.0:devel/py-oslo.messaging@${PY_FLAVOR} \
36
		${PYTHON_PKGNAMEPREFIX}oslo.middleware>=3.0.0:devel/py-oslo.middleware@${PY_FLAVOR} \
36
		${PYTHON_PKGNAMEPREFIX}oslo.middleware>=3.31.0:devel/py-oslo.middleware@${PY_FLAVOR} \
37
		${PYTHON_PKGNAMEPREFIX}oslo.policy>=1.9.0:devel/py-oslo.policy@${PY_FLAVOR} \
37
		${PYTHON_PKGNAMEPREFIX}oslo.policy>=1.30.0:devel/py-oslo.policy@${PY_FLAVOR} \
38
		${PYTHON_PKGNAMEPREFIX}oslo.privsep>=1.9.0:devel/py-oslo.privsep@${PY_FLAVOR} \
38
		${PYTHON_PKGNAMEPREFIX}oslo.privsep>=1.23.0:devel/py-oslo.privsep@${PY_FLAVOR} \
39
		${PYTHON_PKGNAMEPREFIX}oslo.reports>=0.6.0:devel/py-oslo.reports@${PY_FLAVOR} \
39
		${PYTHON_PKGNAMEPREFIX}oslo.reports>=1.18.0:devel/py-oslo.reports@${PY_FLAVOR} \
40
		${PYTHON_PKGNAMEPREFIX}oslo.rootwrap>=5.0.0:devel/py-oslo.rootwrap@${PY_FLAVOR} \
40
		${PYTHON_PKGNAMEPREFIX}oslo.rootwrap>=5.8.0:devel/py-oslo.rootwrap@${PY_FLAVOR} \
41
		${PYTHON_PKGNAMEPREFIX}oslo.serialization>=1.10.0:devel/py-oslo.serialization@${PY_FLAVOR} \
41
		${PYTHON_PKGNAMEPREFIX}oslo.serialization>=2.18.0:devel/py-oslo.serialization@${PY_FLAVOR} \
42
		${PYTHON_PKGNAMEPREFIX}oslo.service>=1.10.0:devel/py-oslo.service@${PY_FLAVOR} \
42
		${PYTHON_PKGNAMEPREFIX}oslo.service>=1.24.0:devel/py-oslo.service@${PY_FLAVOR} \
43
		${PYTHON_PKGNAMEPREFIX}oslo.utils>=3.16.0:devel/py-oslo.utils@${PY_FLAVOR} \
43
		${PYTHON_PKGNAMEPREFIX}oslo.utils>=3.33.0:devel/py-oslo.utils@${PY_FLAVOR} \
44
		${PYTHON_PKGNAMEPREFIX}oslo.versionedobjects>=1.13.0:devel/py-oslo.versionedobjects@${PY_FLAVOR} \
44
		${PYTHON_PKGNAMEPREFIX}oslo.versionedobjects>=1.31.2:devel/py-oslo.versionedobjects@${PY_FLAVOR} \
45
		${PYTHON_PKGNAMEPREFIX}osprofiler>=1.4.0:devel/py-osprofiler@${PY_FLAVOR} \
45
		${PYTHON_PKGNAMEPREFIX}osprofiler>=1.4.0:devel/py-osprofiler@${PY_FLAVOR} \
46
		${PYTHON_PKGNAMEPREFIX}paramiko>=2.0:security/py-paramiko@${PY_FLAVOR} \
46
		${PYTHON_PKGNAMEPREFIX}paramiko>=2.0.0:security/py-paramiko@${PY_FLAVOR} \
47
		${PYTHON_PKGNAMEPREFIX}Paste>=0:www/py-paste@${PY_FLAVOR} \
47
		${PYTHON_PKGNAMEPREFIX}Paste>=2.0.2:www/py-paste@${PY_FLAVOR} \
48
		${PYTHON_PKGNAMEPREFIX}PasteDeploy>=1.5.0:www/py-pastedeploy@${PY_FLAVOR} \
48
		${PYTHON_PKGNAMEPREFIX}PasteDeploy>=1.5.0:www/py-pastedeploy@${PY_FLAVOR} \
49
		${PYTHON_PKGNAMEPREFIX}pycrypto>=2.6:security/py-pycrypto@${PY_FLAVOR} \
49
		${PYTHON_PKGNAMEPREFIX}prettytable>=0.7.1:devel/py-prettytable@${PY_FLAVOR} \
50
		${PYTHON_PKGNAMEPREFIX}pyparsing>=2.0.1:devel/py-pyparsing@${PY_FLAVOR} \
50
		${PYTHON_PKGNAMEPREFIX}psutil>=3.2.2:sysutils/py-psutil@${PY_FLAVOR} \
51
		${PYTHON_PKGNAMEPREFIX}pyparsing>=2.1.0:devel/py-pyparsing@${PY_FLAVOR} \
51
		${PYTHON_PKGNAMEPREFIX}python-barbicanclient>=4.0.0:net/py-python-barbicanclient@${PY_FLAVOR} \
52
		${PYTHON_PKGNAMEPREFIX}python-barbicanclient>=4.0.0:net/py-python-barbicanclient@${PY_FLAVOR} \
52
		${PYTHON_PKGNAMEPREFIX}python-glanceclient>=0:net/py-python-glanceclient@${PY_FLAVOR} \
53
		${PYTHON_PKGNAMEPREFIX}python-glanceclient>=2.8.0:net/py-python-glanceclient@${PY_FLAVOR} \
53
		${PYTHON_PKGNAMEPREFIX}python-keystoneclient>=0:net/py-python-keystoneclient@${PY_FLAVOR} \
54
		${PYTHON_PKGNAMEPREFIX}python-keystoneclient>=3.8.0:net/py-python-keystoneclient@${PY_FLAVOR} \
54
		${PYTHON_PKGNAMEPREFIX}python-novaclient>=0:net/py-python-novaclient@${PY_FLAVOR} \
55
		${PYTHON_PKGNAMEPREFIX}python-novaclient>=9.1.0:net/py-python-novaclient@${PY_FLAVOR} \
55
		${PYTHON_PKGNAMEPREFIX}python-swiftclient>=2.2.0:databases/py-python-swiftclient@${PY_FLAVOR} \
56
		${PYTHON_PKGNAMEPREFIX}python-swiftclient>=3.2.0:databases/py-python-swiftclient@${PY_FLAVOR} \
56
		${PYTHON_PKGNAMEPREFIX}pytz>=2013.6:devel/py-pytz@${PY_FLAVOR} \
57
		${PYTHON_PKGNAMEPREFIX}pytz>=2013.6:devel/py-pytz@${PY_FLAVOR} \
57
		${PYTHON_PKGNAMEPREFIX}requests>=2.10.0:www/py-requests@${PY_FLAVOR} \
58
		${PYTHON_PKGNAMEPREFIX}requests>=2.14.2:www/py-requests@${PY_FLAVOR} \
58
		${PYTHON_PKGNAMEPREFIX}retrying>=0:devel/py-retrying@${PY_FLAVOR} \
59
		${PYTHON_PKGNAMEPREFIX}retrying>=1.2.3:devel/py-retrying@${PY_FLAVOR} \
59
		${PYTHON_PKGNAMEPREFIX}routes>=0:www/py-routes@${PY_FLAVOR} \
60
		${PYTHON_PKGNAMEPREFIX}routes>=2.3.1:www/py-routes@${PY_FLAVOR} \
60
		${PYTHON_PKGNAMEPREFIX}taskflow>=1.26.0:devel/py-taskflow@${PY_FLAVOR} \
61
		${PYTHON_PKGNAMEPREFIX}taskflow>=2.16.0:devel/py-taskflow@${PY_FLAVOR} \
61
		${PYTHON_PKGNAMEPREFIX}rtslib-fb>=0:devel/py-rtslib-fb@${PY_FLAVOR} \
62
		${PYTHON_PKGNAMEPREFIX}rtslib-fb>=2.1.43:devel/py-rtslib-fb@${PY_FLAVOR} \
62
		${PYTHON_PKGNAMEPREFIX}simplejson>=2.2.0:devel/py-simplejson@${PY_FLAVOR} \
63
		${PYTHON_PKGNAMEPREFIX}simplejson>=3.5.1:devel/py-simplejson@${PY_FLAVOR} \
63
		${PYTHON_PKGNAMEPREFIX}six>=1.9.0:devel/py-six@${PY_FLAVOR} \
64
		${PYTHON_PKGNAMEPREFIX}six>=1.10.0:devel/py-six@${PY_FLAVOR} \
64
		${PYTHON_PKGNAMEPREFIX}sqlalchemy10>=0:databases/py-sqlalchemy10@${PY_FLAVOR} \
65
		${PYTHON_PKGNAMEPREFIX}sqlalchemy12>=1.0.10:databases/py-sqlalchemy12@${PY_FLAVOR} \
65
		${PYTHON_PKGNAMEPREFIX}sqlalchemy-migrate>=0.9.6:databases/py-sqlalchemy-migrate@${PY_FLAVOR} \
66
		${PYTHON_PKGNAMEPREFIX}sqlalchemy-migrate>=0.11.0:databases/py-sqlalchemy-migrate@${PY_FLAVOR} \
66
		${PYTHON_PKGNAMEPREFIX}stevedore>=1.16.0:devel/py-stevedore@${PY_FLAVOR} \
67
		${PYTHON_PKGNAMEPREFIX}stevedore>=1.20.0:devel/py-stevedore@${PY_FLAVOR} \
67
		${PYTHON_PKGNAMEPREFIX}webob>=1.2.3:www/py-webob@${PY_FLAVOR} \
68
		${PYTHON_PKGNAMEPREFIX}suds-jurko>=0.6:net/py-suds-jurko@${PY_FLAVOR} \
68
		${PYTHON_PKGNAMEPREFIX}oslo.i18n>=2.1.0:devel/py-oslo.i18n@${PY_FLAVOR} \
69
		${PYTHON_PKGNAMEPREFIX}webob>=1.7.1:www/py-webob@${PY_FLAVOR} \
69
		${PYTHON_PKGNAMEPREFIX}oslo.vmware>=2.11.0:devel/py-oslo.vmware@${PY_FLAVOR} \
70
		${PYTHON_PKGNAMEPREFIX}oslo.i18n>=3.15.3:devel/py-oslo.i18n@${PY_FLAVOR} \
70
		${PYTHON_PKGNAMEPREFIX}os-brick>=1.6.1:devel/py-os-brick@${PY_FLAVOR} \
71
		${PYTHON_PKGNAMEPREFIX}oslo.vmware>=2.17.0:devel/py-oslo.vmware@${PY_FLAVOR} \
71
		${PYTHON_PKGNAMEPREFIX}os-win>=0.2.3:devel/py-os-win@${PY_FLAVOR} \
72
		${PYTHON_PKGNAMEPREFIX}os-brick>=2.2.0:devel/py-os-brick@${PY_FLAVOR} \
72
		${PYTHON_PKGNAMEPREFIX}tooz>=1.28.0:devel/py-tooz@${PY_FLAVOR} \
73
		${PYTHON_PKGNAMEPREFIX}os-win>=3.0.0:devel/py-os-win@${PY_FLAVOR} \
73
		${PYTHON_PKGNAMEPREFIX}google-api-python-client>=1.4.1:www/py-google-api-python-client@${PY_FLAVOR} \
74
		${PYTHON_PKGNAMEPREFIX}tooz>=1.58.0:devel/py-tooz@${PY_FLAVOR} \
74
		${PYTHON_PKGNAMEPREFIX}castellan>=0.4.0:devel/py-castellan@${PY_FLAVOR}
75
		${PYTHON_PKGNAMEPREFIX}google-api-python-client>=1.4.2:www/py-google-api-python-client@${PY_FLAVOR} \
76
		${PYTHON_PKGNAMEPREFIX}castellan>=0.16.0:devel/py-castellan@${PY_FLAVOR} \
77
		${PYTHON_PKGNAMEPREFIX}cryptography>=1.9:security/py-cryptography@${PY_FLAVOR} \
78
		${PY_IPADDRESS} \
79
		${PY_ENUM34}
75
80
76
EXTRA_PATCHES=	${FILESDIR}/01-remotefs.patch:-p1 \
81
USES=		python
77
		${FILESDIR}/02-nfs.patch:-p1
78
79
NO_ARCH=	yes
80
81
USES=		python:2.7
82
USE_PYTHON=	autoplist distutils
82
USE_PYTHON=	autoplist distutils
83
USE_RC_SUBR=	cinder-api cinder-scheduler cinder-volume
83
84
84
USE_RC_SUBR=	cinder-api \
85
		cinder-scheduler \
86
		cinder-volume
87
USERS=		cinder
85
USERS=		cinder
88
GROUPS=		cinder
86
GROUPS=		cinder
89
87
90
post-extract:
88
NO_ARCH=	yes
91
	@(cd ${WRKSRC}/etc/cinder; ${MV} logging_sample.conf logging.conf.sample)
89
SUB_LIST=	PYTHON_VER=${PYTHON_VER}
92
	@(cd ${WRKSRC}/etc/cinder; for f in *.conf; \
93
		do ${MV} $${f} $${f}.sample; done)
94
	# No need to ship this README becuase it tells how to generate sample config
95
	# file using tox, but we ship FreeBSD-friendly sample config already
96
	@${RM} ${WRKSRC}/etc/cinder/README-cinder.conf.sample
97
90
91
CONFLICTS_INSTALL=	py??-cinder-*
92
93
OPTIONS_GROUP=		MISC
94
OPTIONS_GROUP_MISC=	MEMCACHED MONGODB
95
OPTIONS_GROUP_RADIO=	DB
96
OPTIONS_GROUP_RADIO_DB=	MYSQL PGSQL
97
98
MEMCACHED_DESC=		memcached support
99
MONGODB_DESC=		MongoDB support (used for messaging services)
100
MYSQL_DESC=		MySQL/MariaDB support
101
PGSQL_DESC=		PostgreSQL support
102
103
MEMCACHED_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}python-memcached>=1.56:databases/py-python-memcached@${PY_FLAVOR}
104
MONGODB_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pymongo>=3.0.2:databases/pymongo@${PY_FLAVOR}
105
MYSQL_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pymysql>=0:databases/py-pymysql@${PY_FLAVOR}
106
PGSQL_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}psycopg2>=0:databases/py-psycopg2@${PY_FLAVOR}
107
108
MY_CONFFILES=	api-paste.ini rootwrap.conf rootwrap.d/volume.filters
109
MY_REGEX=	(/etc/)(ceph|nova|pki|ssl)
110
98
post-patch:
111
post-patch:
99
	${CP} ${FILESDIR}/cinder.conf.sample \
112
	# Prevent the installation of files into ${ETCDIR} by distutils. We do it
100
		${WRKSRC}/etc/cinder/cinder.conf.sample
113
	# manually in the post-install target
114
	@${REINPLACE_CMD} -e '/etc\//d' ${WRKSRC}/setup.cfg
115
	${CP} ${FILESDIR}/cinder.conf.sample ${WRKSRC}/etc/cinder/cinder.conf
116
	# Replace (hardcoded) paths of config, documentation and Python files
117
	@${GREP} -Rl -Ee '${MY_REGEX}' --null \
118
		${WRKSRC}/etc ${WRKSRC}/doc ${WRKSRC}/cinder | \
119
			${XARGS} -0 ${REINPLACE_CMD} -i '' -Ee \
120
				"s,${MY_REGEX},${PREFIX}\1\2,g"
101
121
102
post-install:
122
post-install:
103
	${MKDIR} ${STAGEDIR}${ETCDIR}
123
	@${MKDIR} ${STAGEDIR}${ETCDIR}/rootwrap.d
104
	${CP} -R ${WRKSRC}/etc/cinder/ ${STAGEDIR}${ETCDIR}
124
.for f in ${MY_CONFFILES} cinder.conf
125
	${INSTALL_DATA} ${WRKSRC}/etc/cinder/$f ${STAGEDIR}${ETCDIR}/$f.sample
126
.endfor
105
127
106
.include <bsd.port.mk>
128
.include <bsd.port.mk>
(-)py-cinder/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1483236622
1
TIMESTAMP = 1539433662
2
SHA256 (cinder-9.1.1.tar.gz) = 455831c90ac6eafde83bb7b57d0c8ee0caf19a419bf760b2451aa7164cc9627d
2
SHA256 (cinder-12.0.4.tar.gz) = b792411f750abada65509c6f39ac9703dc13fd33b5fde1e4e3bd6c75f14e098c
3
SIZE (cinder-9.1.1.tar.gz) = 4201222
3
SIZE (cinder-12.0.4.tar.gz) = 5349921
(-)py-cinder/files/01-remotefs.patch (-45 lines)
Lines 1-45 Link Here
1
From 6c320b98634aa4d3d7b1e9f58b6ca19073cd0b32 Mon Sep 17 00:00:00 2001
2
From: Alexander Nusov <alexander.nusov@nfvexpress.com>
3
Date: Mon, 12 Dec 2016 13:49:04 +0300
4
Subject: [PATCH] fix remotefs
5
6
---
7
 cinder/volume/drivers/remotefs.py | 11 +++++------
8
 1 file changed, 5 insertions(+), 6 deletions(-)
9
10
diff --git a/cinder/volume/drivers/remotefs.py b/cinder/volume/drivers/remotefs.py
11
index 0160b0a..d263bf3 100644
12
--- a/cinder/volume/drivers/remotefs.py
13
+++ b/cinder/volume/drivers/remotefs.py
14
@@ -208,9 +208,9 @@ class RemoteFSDriver(driver.LocalVD, driver.TransferVD, driver.BaseVD):
15
         provisioned_size = 0.0
16
         for share in self.shares.keys():
17
             mount_path = self._get_mount_point_for_share(share)
18
-            out, _ = self._execute('du', '--bytes', mount_path,
19
+            out, _ = self._execute('du', '-k', mount_path,
20
                                    run_as_root=True)
21
-            provisioned_size += int(out.split()[0])
22
+            provisioned_size += int(out.split()[0]) * 1024
23
         return round(provisioned_size / units.Gi, 2)
24
 
25
     def _get_mount_point_base(self):
26
@@ -824,13 +824,12 @@ class RemoteFSSnapDriverBase(RemoteFSDriver, driver.SnapshotVD):
27
         """
28
         mount_point = self._get_mount_point_for_share(share)
29
 
30
-        out, _ = self._execute('df', '--portability', '--block-size', '1',
31
-                               mount_point,
32
+        out, _ = self._execute('df', '-k', mount_point,
33
                                run_as_root=self._execute_as_root)
34
         out = out.splitlines()[1]
35
 
36
-        size = int(out.split()[1])
37
-        available = int(out.split()[3])
38
+        size = int(out.split()[1]) * 1024
39
+        available = int(out.split()[3]) * 1024
40
 
41
         return available, size
42
 
43
-- 
44
2.8.1
45
(-)py-cinder/files/02-nfs.patch (-41 lines)
Lines 1-41 Link Here
1
diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py
2
index d495b4a..0fb33c6 100644
3
--- a/cinder/volume/drivers/nfs.py
4
+++ b/cinder/volume/drivers/nfs.py
5
@@ -139,10 +139,10 @@ class NfsDriver(driver.ExtendVD, remotefs.RemoteFSDriver):
6
 
7
         self.shares = {}  # address : options
8
 
9
-        # Check if mount.nfs is installed on this system; note that we
10
+        # Check if mount_nfs is installed on this system; note that we
11
         # need to be root, to also find mount.nfs on distributions, where
12
         # it is not located in an unprivileged users PATH (e.g. /sbin).
13
-        package = 'mount.nfs'
14
+        package = 'mount_nfs'
15
         try:
16
             self._execute(package, check_exit_code=False,
17
                           run_as_root=True)
18
@@ -299,16 +299,16 @@ class NfsDriver(driver.ExtendVD, remotefs.RemoteFSDriver):
19
 
20
         mount_point = self._get_mount_point_for_share(nfs_share)
21
 
22
-        df, _ = self._execute('stat', '-f', '-c', '%S %b %a', mount_point,
23
+        df, _ = self._execute('df', '-k', mount_point,
24
                               run_as_root=run_as_root)
25
-        block_size, blocks_total, blocks_avail = map(float, df.split())
26
-        total_available = block_size * blocks_avail
27
-        total_size = block_size * blocks_total
28
+        df = df.splitlines()[1]
29
+        block_size = 1024
30
+        total_available = block_size * int(df.split()[3])
31
+        total_size = block_size * int(df.split()[1])
32
 
33
-        du, _ = self._execute('du', '-sb', '--apparent-size', '--exclude',
34
-                              '*snapshot*', mount_point,
35
+        du, _ = self._execute('du', '-Aks', mount_point,
36
                               run_as_root=run_as_root)
37
-        total_allocated = float(du.split()[0])
38
+        total_allocated = float(du.split()[0]) * 1024
39
         return total_size, total_available, total_allocated
40
 
41
     def _get_mount_point_base(self):
(-)py-cinder/files/cinder-api.in (-1 / +1 lines)
Lines 33-39 Link Here
33
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
33
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
34
34
35
pidfile="/var/run/cinder-api.pid"
35
pidfile="/var/run/cinder-api.pid"
36
procname="%%PREFIX%%/bin/python2.7"
36
procname="%%PREFIX%%/bin/python%%PYTHON_VER%%"
37
37
38
start_precmd=cinder_precmd
38
start_precmd=cinder_precmd
39
39
(-)py-cinder/files/cinder-scheduler.in (-1 / +1 lines)
Lines 33-39 Link Here
33
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
33
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
34
34
35
pidfile="/var/run/cinder-scheduler.pid"
35
pidfile="/var/run/cinder-scheduler.pid"
36
procname="%%PREFIX%%/bin/python2.7"
36
procname="%%PREFIX%%/bin/python%%PYTHON_VER%%"
37
37
38
start_precmd=cinder_precmd
38
start_precmd=cinder_precmd
39
39
(-)py-cinder/files/cinder-volume.in (-1 / +1 lines)
Lines 33-39 Link Here
33
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
33
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
34
34
35
pidfile="/var/run/cinder-volume.pid"
35
pidfile="/var/run/cinder-volume.pid"
36
procname="%%PREFIX%%/bin/python2.7"
36
procname="%%PREFIX%%/bin/python%%PYTHON_VER%%"
37
37
38
start_precmd=cinder_precmd
38
start_precmd=cinder_precmd
39
39
(-)py-cinder/files/cinder.conf.sample (-15 / +9 lines)
Lines 1-29 Link Here
1
[DEFAULT]
1
[DEFAULT]
2
rootwrap_config = /usr/local/etc/cinder/rootwrap.conf
3
api_paste_confg = /usr/local/etc/cinder/api-paste.ini
4
iscsi_helper = tgtadm
5
volume_name_template = volume-%s
6
volume_group = cinder-volumes
7
verbose = True
8
auth_strategy = keystone
2
auth_strategy = keystone
9
state_path = /var/lib/cinder
10
lock_path = /var/lock/cinder
11
volumes_dir = /var/lib/cinder/volumes
12
transport_url = rabbit://openstack:RABBIT_PASS@controller
3
transport_url = rabbit://openstack:RABBIT_PASS@controller
13
my_ip = 192.168.1.30
4
my_ip = 192.168.1.30
14
nfs_shares_config = /usr/local/etc/cinder/nfsshares
5
glance_api_servers = http://GLANCEHOST:9292
6
enabled_backends = nfs
7
8
[backend_defaults]
9
#nfs_shares_config = /usr/local/etc/cinder/nfsshares
15
volume_driver = cinder.volume.drivers.nfs.NfsDriver
10
volume_driver = cinder.volume.drivers.nfs.NfsDriver
16
11
17
[database]
12
[database]
18
connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder
13
connection = sqlite:////var/lib/cinder/cinder.db
19
14
20
[keystone_authtoken]
15
[keystone_authtoken]
21
auth_uri = http://controller:5000
16
auth_uri = http://controller:5000
22
auth_url = http://controller:35357
17
auth_url = http://controller:5000
23
memcached_servers = controller:11211
24
auth_type = password
18
auth_type = password
25
project_domain_name = default
19
project_domain_id = default
26
user_domain_name = default
20
user_domain_id = default
27
project_name = service
21
project_name = service
28
username = cinder
22
username = cinder
29
password = cinder
23
password = cinder
(-)py-cinder/files/patch-cinder_volume_drivers_nfs.py (+39 lines)
Line 0 Link Here
1
--- cinder/volume/drivers/nfs.py.orig	2018-06-18 13:37:33 UTC
2
+++ cinder/volume/drivers/nfs.py
3
@@ -182,10 +182,10 @@ class NfsDriver(remotefs.RemoteFSSnapDriverDistributed
4
 
5
         self.shares = {}  # address : options
6
 
7
-        # Check if mount.nfs is installed on this system; note that we
8
+        # Check if mount_nfs is installed on this system; note that we
9
         # need to be root, to also find mount.nfs on distributions, where
10
         # it is not located in an unprivileged users PATH (e.g. /sbin).
11
-        package = 'mount.nfs'
12
+        package = 'mount_nfs'
13
         try:
14
             self._execute(package, check_exit_code=False,
15
                           run_as_root=True)
16
@@ -342,16 +342,16 @@ class NfsDriver(remotefs.RemoteFSSnapDriverDistributed
17
         """
18
         mount_point = self._get_mount_point_for_share(nfs_share)
19
 
20
-        df, _ = self._execute('stat', '-f', '-c', '%S %b %a', mount_point,
21
+        df, _ = self._execute('df', '-k', mount_point,
22
                               run_as_root=self._execute_as_root)
23
-        block_size, blocks_total, blocks_avail = map(float, df.split())
24
-        total_available = block_size * blocks_avail
25
-        total_size = block_size * blocks_total
26
+        df = df.splitlines()[1]
27
+        block_size = 1024
28
+        total_available = block_size * int(df.split()[3])
29
+        total_size = block_size * int(df.split()[1])
30
 
31
-        du, _ = self._execute('du', '-sb', '--apparent-size', '--exclude',
32
-                              '*snapshot*', mount_point,
33
+        du, _ = self._execute('du', '-Aks', mount_point,
34
                               run_as_root=self._execute_as_root)
35
-        total_allocated = float(du.split()[0])
36
+        total_allocated = float(du.split()[0]) * 1024
37
         return total_size, total_available, total_allocated
38
 
39
     def _get_mount_point_base(self):
(-)py-cinder/files/patch-cinder_volume_drivers_remotefs.py (+31 lines)
Line 0 Link Here
1
--- cinder/volume/drivers/remotefs.py.orig	2018-10-09 19:58:17 UTC
2
+++ cinder/volume/drivers/remotefs.py
3
@@ -217,9 +217,9 @@ class RemoteFSDriver(driver.BaseVD):
4
         provisioned_size = 0.0
5
         for share in self.shares.keys():
6
             mount_path = self._get_mount_point_for_share(share)
7
-            out, _ = self._execute('du', '--bytes', '-s', mount_path,
8
+            out, _ = self._execute('du', '-k', mount_path,
9
                                    run_as_root=self._execute_as_root)
10
-            provisioned_size += int(out.split()[0])
11
+            provisioned_size += int(out.split()[0]) * 1024
12
         return round(provisioned_size / units.Gi, 2)
13
 
14
     def _get_mount_point_base(self):
15
@@ -892,13 +892,12 @@ class RemoteFSSnapDriverBase(RemoteFSDriver):
16
         """
17
         mount_point = self._get_mount_point_for_share(share)
18
 
19
-        out, _ = self._execute('df', '--portability', '--block-size', '1',
20
-                               mount_point,
21
+        out, _ = self._execute('df', '-k', mount_point,
22
                                run_as_root=self._execute_as_root)
23
         out = out.splitlines()[1]
24
 
25
-        size = int(out.split()[1])
26
-        available = int(out.split()[3])
27
+        size = int(out.split()[1]) * 1024
28
+        available = int(out.split()[3]) * 1024
29
 
30
         return available, size
31
 
(-)py-cinder/pkg-message (-4 / +16 lines)
Lines 1-5 Link Here
1
Please note that this is a development version.
1
==============================================================================
2
Only initial NFS support was added.
3
2
4
Enable NFS client in rc.conf
3
For installation instructions please refer to the related wiki page:
5
# sysrc nfs_client_enable="YES"
4
5
- https://wiki.freebsd.org/Ports/misc/py-cinder
6
7
Please note that this is a development version and only initial NFS support
8
has been tested so far.
9
10
The supplied cinder.conf file is a distilled configuration which reflects the
11
required settings to setup a Cinder controller/storage node with NFS support.
12
13
A extensive sample configuration file can be retrieved at:
14
15
https://docs.openstack.org/cinder/queens/_static/cinder.conf.sample
16
17
==============================================================================
(-)py-cinder/pkg-plist (-6 / +3 lines)
Lines 1-11 Link Here
1
@owner cinder
1
@owner cinder
2
@dir %%ETCDIR%%
2
@dir %%ETCDIR%%
3
@sample %%ETCDIR%%/api-httpd.conf.sample
3
@sample %%ETCDIR%%/api-paste.ini.sample
4
@sample %%ETCDIR%%/logging.conf.sample
5
@sample %%ETCDIR%%/cinder.conf.sample
4
@sample %%ETCDIR%%/cinder.conf.sample
6
%%ETCDIR%%/api-paste.ini
7
%%ETCDIR%%/policy.json
8
@owner root
5
@owner root
9
@sample %%ETCDIR%%/rootwrap.conf.sample
6
@sample %%ETCDIR%%/rootwrap.conf.sample
10
@dir etc/cinder/rootwrap.d
7
@dir %%ETCDIR%%/rootwrap.d
11
%%ETCDIR%%/rootwrap.d/volume.filters
8
@sample %%ETCDIR%%/rootwrap.d/volume.filters.sample

Return to bug 232245