mirror of
https://git.freebsd.org/ports.git
synced 2025-07-14 15:59:18 -04:00
45 lines
1.7 KiB
Diff
45 lines
1.7 KiB
Diff
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):
|
|
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', '-k', mount_path,
|
|
run_as_root=True)
|
|
- 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):
|
|
"""
|
|
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
|
|
|
|
--
|
|
2.8.1
|
|
|