1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-19 00:13:33 +00:00

- Update to 12.0.4

- Added LICENSE_FILE
- Changed MASTER_SITES to official OpenStack repository
- Removed EXTRA_PATCHES (those patches have been rebased and were converted into
  mandatory patches)
- Enabled building for Python 3+ versions
- Sorted variables according to the PHB
- Changed RC scripts to work with different Python versions
- Added CONFLICTS_INSTALL
- Added OPTIONS for MySQL, PostgreSQL, memcached and MongoDB support
- changed post-patch target to prevent the installation to files into ${ETCDIR}
  by distutils and to replace occurences of /etc to ${PREFIX}/etc
- Changed post-install target to install the files into ${ETCDIR}
- Updated the shipped cinder.conf.sample
- Updated pkg-message

PR:		232245
Submitted by:	freebsd_ports@k-worx.org
Approved by:	maintainer
Sponsored by:	iXsystems Inc.
This commit is contained in:
Martin Wilke 2019-01-29 14:05:58 +00:00
parent 599f96436c
commit 070a6ba29d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=491564
10 changed files with 144 additions and 135 deletions

View File

@ -2,105 +2,127 @@
# $FreeBSD$
PORTNAME= cinder
PORTVERSION= 9.1.1
PORTREVISION= 3
PORTVERSION= 12.0.4
CATEGORIES= misc python
MASTER_SITES= https://fossies.org/linux/misc/openstack/
MASTER_SITES= https://tarballs.openstack.org/cinder/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= alexander.nusov@nfvexpress.com
COMMENT= OpenStack Storage Service (Cinder)
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pbr>=1.6:devel/py-pbr@${PY_FLAVOR}
RUN_DEPENDS:= ${BUILD_DEPENDS}
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}Babel>=2.3.4:devel/py-babel@${PY_FLAVOR} \
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pbr>=2.0.0:devel/py-pbr@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pbr>=2.0.0:devel/py-pbr@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}Babel>=2.3.4:devel/py-babel@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}decorator>=3.4.0:devel/py-decorator@${PY_FLAVOR} \
${PY_ENUM34} \
${PYTHON_PKGNAMEPREFIX}eventlet>=0:net/py-eventlet@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}greenlet>=0.3.2:devel/py-greenlet@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}httplib2>=0.7.5:www/py-httplib2@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}defusedxml>=0.5.0:devel/py-defusedxml@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}eventlet>=0.18.2:net/py-eventlet@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}greenlet>=0.4.10:devel/py-greenlet@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}httplib2>=0.9.1:www/py-httplib2@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}iso8601>=0.1.11:devel/py-iso8601@${PY_FLAVOR} \
${PY_IPADDRESS} \
${PYTHON_PKGNAMEPREFIX}keystoneauth1>=2.10.0:devel/py-keystoneauth1@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}keystonemiddleware>=0:devel/py-keystonemiddleware@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}lxml>=2.3:devel/py-lxml@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}jsonschema>=2.6.0:devel/py-jsonschema@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}keystoneauth1>=3.3.0:devel/py-keystoneauth1@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}keystonemiddleware>=4.17.0:devel/py-keystonemiddleware@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}lxml>=3.4.1:devel/py-lxml@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oauth2client>=1.5.0:security/py-oauth2client@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.config>=3.14.0:devel/py-oslo.config@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.concurrency>=3.8.0:devel/py-oslo.concurrency@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.context>=2.9.0:devel/py-oslo.context@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.db>=0:devel/py-oslo.db@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.log>=1.14.0:devel/py-oslo.log@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.messaging>=5.2.0:devel/py-oslo.messaging@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.middleware>=3.0.0:devel/py-oslo.middleware@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.policy>=1.9.0:devel/py-oslo.policy@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.privsep>=1.9.0:devel/py-oslo.privsep@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.reports>=0.6.0:devel/py-oslo.reports@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.rootwrap>=5.0.0:devel/py-oslo.rootwrap@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.serialization>=1.10.0:devel/py-oslo.serialization@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.service>=1.10.0:devel/py-oslo.service@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.utils>=3.16.0:devel/py-oslo.utils@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.versionedobjects>=1.13.0:devel/py-oslo.versionedobjects@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.config>=5.1.0:devel/py-oslo.config@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.concurrency>=3.25.0:devel/py-oslo.concurrency@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.context>=2.19.2:devel/py-oslo.context@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.db>=4.27.0:devel/py-oslo.db@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.log>=3.36.0:devel/py-oslo.log@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.messaging>=5.29.0:devel/py-oslo.messaging@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.middleware>=3.31.0:devel/py-oslo.middleware@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.policy>=1.30.0:devel/py-oslo.policy@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.privsep>=1.23.0:devel/py-oslo.privsep@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.reports>=1.18.0:devel/py-oslo.reports@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.rootwrap>=5.8.0:devel/py-oslo.rootwrap@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.serialization>=2.18.0:devel/py-oslo.serialization@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.service>=1.24.0:devel/py-oslo.service@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.utils>=3.33.0:devel/py-oslo.utils@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.versionedobjects>=1.31.2:devel/py-oslo.versionedobjects@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}osprofiler>=1.4.0:devel/py-osprofiler@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}paramiko>=2.0:security/py-paramiko@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}Paste>=0:www/py-paste@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}paramiko>=2.0.0:security/py-paramiko@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}Paste>=2.0.2:www/py-paste@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}PasteDeploy>=1.5.0:www/py-pastedeploy@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pycrypto>=2.6:security/py-pycrypto@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pyparsing>=2.0.1:devel/py-pyparsing@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}prettytable>=0.7.1:devel/py-prettytable@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}psutil>=3.2.2:sysutils/py-psutil@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pyparsing>=2.1.0:devel/py-pyparsing@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}python-barbicanclient>=4.0.0:net/py-python-barbicanclient@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}python-glanceclient>=0:net/py-python-glanceclient@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}python-keystoneclient>=0:net/py-python-keystoneclient@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}python-novaclient>=0:net/py-python-novaclient@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}python-swiftclient>=2.2.0:databases/py-python-swiftclient@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}python-glanceclient>=2.8.0:net/py-python-glanceclient@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}python-keystoneclient>=3.8.0:net/py-python-keystoneclient@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}python-novaclient>=9.1.0:net/py-python-novaclient@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}python-swiftclient>=3.2.0:databases/py-python-swiftclient@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytz>=2013.6:devel/py-pytz@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}requests>=2.10.0:www/py-requests@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}retrying>=0:devel/py-retrying@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}routes>=0:www/py-routes@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}taskflow>=1.26.0:devel/py-taskflow@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}rtslib-fb>=0:devel/py-rtslib-fb@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}simplejson>=2.2.0:devel/py-simplejson@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}six>=1.9.0:devel/py-six@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}sqlalchemy12>=0:databases/py-sqlalchemy12@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}sqlalchemy-migrate>=0.9.6:databases/py-sqlalchemy-migrate@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}stevedore>=1.16.0:devel/py-stevedore@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}webob>=1.2.3:www/py-webob@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.i18n>=2.1.0:devel/py-oslo.i18n@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.vmware>=2.11.0:devel/py-oslo.vmware@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}os-brick>=1.6.1:devel/py-os-brick@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}os-win>=0.2.3:devel/py-os-win@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}tooz>=1.28.0:devel/py-tooz@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}google-api-python-client>=1.4.1:www/py-google-api-python-client@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}castellan>=0.4.0:devel/py-castellan@${PY_FLAVOR}
${PYTHON_PKGNAMEPREFIX}requests>=2.14.2:www/py-requests@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}retrying>=1.2.3:devel/py-retrying@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}routes>=2.3.1:www/py-routes@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}taskflow>=2.16.0:devel/py-taskflow@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}rtslib-fb>=2.1.43:devel/py-rtslib-fb@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}simplejson>=3.5.1:devel/py-simplejson@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}six>=1.10.0:devel/py-six@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}sqlalchemy12>=1.0.10:databases/py-sqlalchemy12@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}sqlalchemy-migrate>=0.11.0:databases/py-sqlalchemy-migrate@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}stevedore>=1.20.0:devel/py-stevedore@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}suds-jurko>=0.6:net/py-suds-jurko@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}webob>=1.7.1:www/py-webob@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.i18n>=3.15.3:devel/py-oslo.i18n@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}oslo.vmware>=2.17.0:devel/py-oslo.vmware@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}os-brick>=2.2.0:devel/py-os-brick@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}os-win>=3.0.0:devel/py-os-win@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}tooz>=1.58.0:devel/py-tooz@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}google-api-python-client>=1.4.2:www/py-google-api-python-client@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}castellan>=0.16.0:devel/py-castellan@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}cryptography>=1.9:security/py-cryptography@${PY_FLAVOR} \
${PY_IPADDRESS} \
${PY_ENUM34}
EXTRA_PATCHES= ${FILESDIR}/01-remotefs.patch:-p1 \
${FILESDIR}/02-nfs.patch:-p1
NO_ARCH= yes
USES= python:2.7
USES= python
USE_PYTHON= autoplist distutils
USE_RC_SUBR= cinder-api cinder-scheduler cinder-volume
USE_RC_SUBR= cinder-api \
cinder-scheduler \
cinder-volume
USERS= cinder
GROUPS= cinder
post-extract:
@(cd ${WRKSRC}/etc/cinder; ${MV} logging_sample.conf logging.conf.sample)
@(cd ${WRKSRC}/etc/cinder; for f in *.conf; \
do ${MV} $${f} $${f}.sample; done)
# No need to ship this README becuase it tells how to generate sample config
# file using tox, but we ship FreeBSD-friendly sample config already
@${RM} ${WRKSRC}/etc/cinder/README-cinder.conf.sample
NO_ARCH= yes
SUB_LIST= PYTHON_VER=${PYTHON_VER}
CONFLICTS_INSTALL= py??-cinder-*
OPTIONS_GROUP= MISC
OPTIONS_GROUP_MISC= MEMCACHED MONGODB
OPTIONS_GROUP_RADIO= DB
OPTIONS_GROUP_RADIO_DB= MYSQL PGSQL
MEMCACHED_DESC= memcached support
MONGODB_DESC= MongoDB support (used for messaging services)
MYSQL_DESC= MySQL/MariaDB support
PGSQL_DESC= PostgreSQL support
MEMCACHED_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}python-memcached>=1.56:databases/py-python-memcached@${PY_FLAVOR}
MONGODB_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pymongo>=3.0.2:databases/pymongo@${PY_FLAVOR}
MYSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pymysql>=0:databases/py-pymysql@${PY_FLAVOR}
PGSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}psycopg2>=0:databases/py-psycopg2@${PY_FLAVOR}
MY_CONFFILES= api-paste.ini rootwrap.conf rootwrap.d/volume.filters
MY_REGEX= (/etc/)(ceph|nova|pki|ssl)
post-patch:
${CP} ${FILESDIR}/cinder.conf.sample \
${WRKSRC}/etc/cinder/cinder.conf.sample
# Prevent the installation of files into ${ETCDIR} by distutils. We do it
# manually in the post-install target
@${REINPLACE_CMD} -e '/etc\//d' ${WRKSRC}/setup.cfg
${CP} ${FILESDIR}/cinder.conf.sample ${WRKSRC}/etc/cinder/cinder.conf
# Replace (hardcoded) paths of config, documentation and Python files
@${GREP} -Rl -Ee '${MY_REGEX}' --null \
${WRKSRC}/etc ${WRKSRC}/doc ${WRKSRC}/cinder | \
${XARGS} -0 ${REINPLACE_CMD} -i '' -Ee \
"s,${MY_REGEX},${PREFIX}\1\2,g"
post-install:
${MKDIR} ${STAGEDIR}${ETCDIR}
${CP} -R ${WRKSRC}/etc/cinder/ ${STAGEDIR}${ETCDIR}
@${MKDIR} ${STAGEDIR}${ETCDIR}/rootwrap.d
.for f in ${MY_CONFFILES} cinder.conf
${INSTALL_DATA} ${WRKSRC}/etc/cinder/$f ${STAGEDIR}${ETCDIR}/$f.sample
.endfor
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1483236622
SHA256 (cinder-9.1.1.tar.gz) = 455831c90ac6eafde83bb7b57d0c8ee0caf19a419bf760b2451aa7164cc9627d
SIZE (cinder-9.1.1.tar.gz) = 4201222
TIMESTAMP = 1539433662
SHA256 (cinder-12.0.4.tar.gz) = b792411f750abada65509c6f39ac9703dc13fd33b5fde1e4e3bd6c75f14e098c
SIZE (cinder-12.0.4.tar.gz) = 5349921

View File

@ -33,7 +33,7 @@ rcvar=cinder_api_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/cinder-api.pid"
procname="%%PREFIX%%/bin/python2.7"
procname="%%PREFIX%%/bin/python%%PYTHON_VER%%"
start_precmd=cinder_precmd

View File

@ -33,7 +33,7 @@ rcvar=cinder_scheduler_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/cinder-scheduler.pid"
procname="%%PREFIX%%/bin/python2.7"
procname="%%PREFIX%%/bin/python%%PYTHON_VER%%"
start_precmd=cinder_precmd

View File

@ -33,7 +33,7 @@ rcvar=cinder_volume_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/cinder-volume.pid"
procname="%%PREFIX%%/bin/python2.7"
procname="%%PREFIX%%/bin/python%%PYTHON_VER%%"
start_precmd=cinder_precmd

View File

@ -1,29 +1,23 @@
[DEFAULT]
rootwrap_config = /usr/local/etc/cinder/rootwrap.conf
api_paste_confg = /usr/local/etc/cinder/api-paste.ini
iscsi_helper = tgtadm
volume_name_template = volume-%s
volume_group = cinder-volumes
verbose = True
auth_strategy = keystone
state_path = /var/lib/cinder
lock_path = /var/lock/cinder
volumes_dir = /var/lib/cinder/volumes
transport_url = rabbit://openstack:RABBIT_PASS@controller
my_ip = 192.168.1.30
nfs_shares_config = /usr/local/etc/cinder/nfsshares
glance_api_servers = http://GLANCEHOST:9292
enabled_backends = nfs
[backend_defaults]
#nfs_shares_config = /usr/local/etc/cinder/nfsshares
volume_driver = cinder.volume.drivers.nfs.NfsDriver
[database]
connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder
connection = sqlite:////var/lib/cinder/cinder.db
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
project_domain_id = default
user_domain_id = default
project_name = service
username = cinder
password = cinder

View File

@ -1,8 +1,6 @@
diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py
index d495b4a..0fb33c6 100644
--- a/cinder/volume/drivers/nfs.py
+++ b/cinder/volume/drivers/nfs.py
@@ -139,10 +139,10 @@ class NfsDriver(driver.ExtendVD, remotefs.RemoteFSDriver):
--- cinder/volume/drivers/nfs.py.orig 2018-06-18 13:37:33 UTC
+++ cinder/volume/drivers/nfs.py
@@ -182,10 +182,10 @@ class NfsDriver(remotefs.RemoteFSSnapDriverDistributed
self.shares = {} # address : options
@ -15,13 +13,13 @@ index d495b4a..0fb33c6 100644
try:
self._execute(package, check_exit_code=False,
run_as_root=True)
@@ -299,16 +299,16 @@ class NfsDriver(driver.ExtendVD, remotefs.RemoteFSDriver):
@@ -342,16 +342,16 @@ class NfsDriver(remotefs.RemoteFSSnapDriverDistributed
"""
mount_point = self._get_mount_point_for_share(nfs_share)
- df, _ = self._execute('stat', '-f', '-c', '%S %b %a', mount_point,
+ df, _ = self._execute('df', '-k', mount_point,
run_as_root=run_as_root)
run_as_root=self._execute_as_root)
- block_size, blocks_total, blocks_avail = map(float, df.split())
- total_available = block_size * blocks_avail
- total_size = block_size * blocks_total
@ -33,7 +31,7 @@ index d495b4a..0fb33c6 100644
- du, _ = self._execute('du', '-sb', '--apparent-size', '--exclude',
- '*snapshot*', mount_point,
+ du, _ = self._execute('du', '-Aks', mount_point,
run_as_root=run_as_root)
run_as_root=self._execute_as_root)
- total_allocated = float(du.split()[0])
+ total_allocated = float(du.split()[0]) * 1024
return total_size, total_available, total_allocated

View File

@ -1,29 +1,18 @@
From 6c320b98634aa4d3d7b1e9f58b6ca19073cd0b32 Mon Sep 17 00:00:00 2001
From: Alexander Nusov <alexander.nusov@nfvexpress.com>
Date: Mon, 12 Dec 2016 13:49:04 +0300
Subject: [PATCH] fix remotefs
---
cinder/volume/drivers/remotefs.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/cinder/volume/drivers/remotefs.py b/cinder/volume/drivers/remotefs.py
index 0160b0a..d263bf3 100644
--- a/cinder/volume/drivers/remotefs.py
+++ b/cinder/volume/drivers/remotefs.py
@@ -208,9 +208,9 @@ class RemoteFSDriver(driver.LocalVD, driver.TransferVD, driver.BaseVD):
--- cinder/volume/drivers/remotefs.py.orig 2018-10-09 19:58:17 UTC
+++ cinder/volume/drivers/remotefs.py
@@ -217,9 +217,9 @@ class RemoteFSDriver(driver.BaseVD):
provisioned_size = 0.0
for share in self.shares.keys():
mount_path = self._get_mount_point_for_share(share)
- out, _ = self._execute('du', '--bytes', mount_path,
- out, _ = self._execute('du', '--bytes', '-s', mount_path,
+ out, _ = self._execute('du', '-k', mount_path,
run_as_root=True)
run_as_root=self._execute_as_root)
- provisioned_size += int(out.split()[0])
+ provisioned_size += int(out.split()[0]) * 1024
return round(provisioned_size / units.Gi, 2)
def _get_mount_point_base(self):
@@ -824,13 +824,12 @@ class RemoteFSSnapDriverBase(RemoteFSDriver, driver.SnapshotVD):
@@ -892,13 +892,12 @@ class RemoteFSSnapDriverBase(RemoteFSDriver):
"""
mount_point = self._get_mount_point_for_share(share)
@ -40,6 +29,3 @@ index 0160b0a..d263bf3 100644
return available, size
--
2.8.1

View File

@ -1,5 +1,17 @@
Please note that this is a development version.
Only initial NFS support was added.
==============================================================================
Enable NFS client in rc.conf
# sysrc nfs_client_enable="YES"
For installation instructions please refer to the related wiki page:
- https://wiki.freebsd.org/Ports/misc/py-cinder
Please note that this is a development version and only initial NFS support
has been tested so far.
The supplied cinder.conf file is a distilled configuration which reflects the
required settings to setup a Cinder controller/storage node with NFS support.
A extensive sample configuration file can be retrieved at:
https://docs.openstack.org/cinder/queens/_static/cinder.conf.sample
==============================================================================

View File

@ -1,11 +1,8 @@
@owner cinder
@dir %%ETCDIR%%
@sample %%ETCDIR%%/api-httpd.conf.sample
@sample %%ETCDIR%%/logging.conf.sample
@sample %%ETCDIR%%/api-paste.ini.sample
@sample %%ETCDIR%%/cinder.conf.sample
%%ETCDIR%%/api-paste.ini
%%ETCDIR%%/policy.json
@owner root
@sample %%ETCDIR%%/rootwrap.conf.sample
@dir etc/cinder/rootwrap.d
%%ETCDIR%%/rootwrap.d/volume.filters
@dir %%ETCDIR%%/rootwrap.d
@sample %%ETCDIR%%/rootwrap.d/volume.filters.sample