aboutsummaryrefslogtreecommitdiff
path: root/misc/py-cinder/files/01-remotefs.patch
blob: 791c9b5ac5ac9c17a97f57d8cf6fec6b32567d0f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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