ports/misc/py-cinder/files/patch-cinder_volume_drivers_remotefs.py
Martin Wilke 070a6ba29d - 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.
2019-01-29 14:05:58 +00:00

31 lines
1.3 KiB
Python

--- 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', '-s', mount_path,
+ out, _ = self._execute('du', '-k', mount_path,
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):
@@ -892,13 +892,12 @@ class RemoteFSSnapDriverBase(RemoteFSDriver):
"""
mount_point = self._get_mount_point_for_share(share)
- out, _ = self._execute('df', '--portability', '--block-size', '1',
- mount_point,
+ out, _ = self._execute('df', '-k', mount_point,
run_as_root=self._execute_as_root)
out = out.splitlines()[1]
- size = int(out.split()[1])
- available = int(out.split()[3])
+ size = int(out.split()[1]) * 1024
+ available = int(out.split()[3]) * 1024
return available, size