components/openstack/cinder/patches/18-nfs-du-option.patch
author saurabh.vyas@oracle.com
Tue, 21 Mar 2017 20:35:40 -0700
branchs11u3-sru
changeset 7789 d23f3837744d
permissions -rw-r--r--
25657521 OpenStack Cinder NFS driver can not detect capacity info
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7789
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
     1
--- cinder-8.0.0/cinder/volume/drivers/nfs.py.orig	2017-03-15 04:36:02.909935308 +0000
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
     2
+++ cinder-8.0.0/cinder/volume/drivers/nfs.py	2017-03-15 04:38:41.033711742 +0000
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
     3
@@ -294,9 +294,10 @@
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
     4
         total_available = block_size * blocks_avail
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
     5
         total_size = block_size * blocks_total
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
     6
 
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
     7
-        du, _ = self._execute('du', '-sb', '--apparent-size', '--exclude',
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
     8
-                              '*snapshot*', mount_point,
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
     9
+        du, _ = self._execute('/usr/bin/gdu', '-sb', '--apparent-size',
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
    10
+                              '--exclude', '*snapshot*', mount_point,
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
    11
                               run_as_root=run_as_root)
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
    12
+
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
    13
         total_allocated = float(du.split()[0])
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
    14
         return total_size, total_available, total_allocated
d23f3837744d 25657521 OpenStack Cinder NFS driver can not detect capacity info
saurabh.vyas@oracle.com
parents:
diff changeset
    15