diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2018-06-20 11:38:59 -0400 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-06-21 10:09:25 +0000 |
commit | 4b7707382bc763f089e14334c2b7f3139e186c1f (patch) | |
tree | 03d8fd689baa92abcaa593f15d4e2d21dd9d57e3 /extras/quota/xattr_analysis.py | |
parent | fe9b72485697a035b3dbb11b83048dd31de5863e (diff) |
core/various: python3 compat, prepare for python2 -> python3
see https://review.gluster.org/#/c/19788/,
https://review.gluster.org/#/c/19871/,
https://review.gluster.org/#/c/19952/,
https://review.gluster.org/#/c/20104/,
https://review.gluster.org/#/c/20162/,
https://review.gluster.org/#/c/20185/,
https://review.gluster.org/#/c/20207/,
https://review.gluster.org/#/c/20227/,
https://review.gluster.org/#/c/20307/, and
https://review.gluster.org/#/c/20320/
This patch fixes more selected comma white space (ws_comma) as suggested
by the 2to3 utility. (Earlier attempts to fix all ws_comma in one
patch did not pass centos regression, hence multiple patches to identify
the change that causes the failure.)
Note: Fedora packaging guidelines and SUSE rpmlint require explicit
shebangs; popular practices like #!/usr/bin/env python and #!/usr/bin/python
are not allowed; they must be #!/usr/bin/python2 or #!/usr/bin/python3
Note: Selected small fixes from 2to3 utility. Specifically apply,
basestring, funcattrs, has_key, idioms, map, numliterals, raise,
set_literal, types, urllib, and zip have already been applied. Also
version agnostic imports for urllib, cpickle, socketserver, _thread,
queue, etc., suggested by Aravinda in https://review.gluster.org/#/c/19767/1
Note: these 2to3 fixes report no changes are necessary: asserts, buffer,
exec, execfile, exitfunc, filter, getcwdu, imports2, input, intern,
itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren,
raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw,
tuple_params, xreadlines.
Change-Id: I6e5a2408fa1fc81e00e66d6e4a7f9f6fa1d1ed15
updates: #411
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'extras/quota/xattr_analysis.py')
-rwxr-xr-x | extras/quota/xattr_analysis.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/extras/quota/xattr_analysis.py b/extras/quota/xattr_analysis.py index 9a178e058c2..a68eb341e19 100755 --- a/extras/quota/xattr_analysis.py +++ b/extras/quota/xattr_analysis.py @@ -28,7 +28,7 @@ def get_quota_xattr_brick(): mismatch_size = [('====contri_size===', '====size====')] for xattr in pairs: k = xattr.split("=")[0] - if re.search("# file:",k): + if re.search("# file:", k): print(xdict) filename=k print("=====" + filename + "=======") @@ -38,7 +38,7 @@ def get_quota_xattr_brick(): else: print(xattr) v = xattr.split("=")[1] - if re.search("contri",k): + if re.search("contri", k): if len(v) == 34: # for files size is obtained in iatt, file count should be 1, dir count=0 xdict['contri_file_count'] = int(v[18:34], 16) @@ -47,18 +47,18 @@ def get_quota_xattr_brick(): xdict['contri_size'] = size(int(v[2:18], 16)) xdict['contri_file_count'] = int(v[18:34], 16) xdict['contri_dir_count'] = int(v[34:], 16) - elif re.search("size",k): + elif re.search("size", k): xdict['size'] = size(int(v[2:18], 16)) xdict['file_count'] = int(v[18:34], 16) xdict['dir_count'] = int(v[34:], 16) - elif re.search("dirty",k): + elif re.search("dirty", k): if v == '0x3000': xdict['dirty'] = False elif v == '0x3100': xdict['dirty'] = True - elif re.search("limit_objects",k): + elif re.search("limit_objects", k): xdict['limit_objects'] = int(v[2:18], 16) - elif re.search("limit_set",k): + elif re.search("limit_set", k): xdict['limit_set'] = size(int(v[2:18], 16)) if 'size' in xdict and 'contri_size' in xdict and xdict['size'] != xdict['contri_size']: |