diff options
Diffstat (limited to 'ufo/gluster')
-rw-r--r-- | ufo/gluster/swift/common/Glusterfs.py | 7 | ||||
-rw-r--r-- | ufo/gluster/swift/common/utils.py | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ufo/gluster/swift/common/Glusterfs.py b/ufo/gluster/swift/common/Glusterfs.py index 6cbdf6c3551..1053610b386 100644 --- a/ufo/gluster/swift/common/Glusterfs.py +++ b/ufo/gluster/swift/common/Glusterfs.py @@ -27,6 +27,7 @@ MOUNT_IP = 'localhost' OBJECT_ONLY = False RUN_DIR='/var/run/swift' SWIFT_DIR = '/etc/swift' +_do_getsize = False if _fs_conf.read(os.path.join('/etc/swift', 'fs.conf')): try: MOUNT_IP = _fs_conf.get('DEFAULT', 'mount_ip', 'localhost') @@ -41,6 +42,12 @@ if _fs_conf.read(os.path.join('/etc/swift', 'fs.conf')): except (NoSectionError, NoOptionError): pass + try: + _do_getsize = _fs_conf.get('DEFAULT', 'accurate_size_in_listing', \ + "no") in TRUE_VALUES + except (NoSectionError, NoOptionError): + pass + NAME = 'glusterfs' diff --git a/ufo/gluster/swift/common/utils.py b/ufo/gluster/swift/common/utils.py index 7e9f8a60f74..f2cd8dea10c 100644 --- a/ufo/gluster/swift/common/utils.py +++ b/ufo/gluster/swift/common/utils.py @@ -241,7 +241,7 @@ def _update_list(path, cont_path, src_list, reg_file=True, object_count=0, object_count += 1 - if reg_file: + if Glusterfs._do_getsize and reg_file: bytes_used += os_path.getsize(os.path.join(path, obj_name)) sleep() |