diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2018-06-19 10:56:37 -0400 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-06-21 05:45:08 +0000 |
commit | fe9b72485697a035b3dbb11b83048dd31de5863e (patch) | |
tree | 8b265ee06edbe83c762d0124efd76cdcecebe1cf /extras/prot_filter.py | |
parent | 2bab841316025c402b97c877ccc4ee9188c929e0 (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/, and
https://review.gluster.org/#/c/20307/
This patch fixes more selected comma white space (ws_comma) as suggested
by the 2to3 utility.
Note: Fedora packaging guidelines and SUSE rpmlint require explicit
shebangs, so popular practices like #!/usr/bin/env python and
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: I60932030813484803f73733a9b2b7b23c7a843fd
updates: #411
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'extras/prot_filter.py')
-rwxr-xr-x | extras/prot_filter.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/extras/prot_filter.py b/extras/prot_filter.py index 099832fc08a..e2b81218f40 100755 --- a/extras/prot_filter.py +++ b/extras/prot_filter.py @@ -43,7 +43,7 @@ def load (path): # If it's a string, open it; otherwise, assume it's already a # file-like object (most notably from urllib*). if type(path) in (str,): - fp = file(path,"r") + fp = file(path, "r") else: fp = path all_xlators = {} @@ -86,7 +86,7 @@ def load (path): def generate (graph, last, stream=sys.stdout): for sv in last.subvols: if not sv.dumped: - generate(graph,sv,stream) + generate(graph, sv, stream) print("", file=stream) sv.dumped = True print("volume %s" % last.name, file=stream) @@ -133,13 +133,13 @@ if __name__ == "__main__": sys.exit(0) for v in graph.values(): if v.xl_type == "cluster/distribute": - push_filter(graph,v,"features/prot_dht") + push_filter(graph, v, "features/prot_dht") elif v.xl_type == "protocol/client": - push_filter(graph,v,"features/prot_client") + push_filter(graph, v, "features/prot_client") # We push debug/trace so that every fop gets a real frame, because DHT # gets confused if STACK_WIND_TAIL causes certain fops to be invoked # from anything other than a direct child. for v in graph.values(): if v.xl_type == "features/prot_client": - push_filter(graph,v,"debug/trace") - generate(graph,last,stream=open(path,"w")) + push_filter(graph, v, "debug/trace") + generate(graph, last, stream=open(path, "w")) |