summaryrefslogtreecommitdiffstats
path: root/xlators/experimental/jbr-client
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2018-06-18 09:17:26 -0400
committerPrashanth Pai <ppai@redhat.com>2018-06-19 12:33:34 +0000
commitf816a6e838f8c52f1b8317ae6f1a4103f9267ba6 (patch)
tree6e5dc291db9cab744f15fa7029caee6ac94f68e3 /xlators/experimental/jbr-client
parent64d21769eef85e2588cbe9481a389dc4d68a3cb1 (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/, and https://review.gluster.org/#/c/20227/ This patch fixes 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: I691d7f86279572642902650ed1c24840e3c4b781 Updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/experimental/jbr-client')
-rwxr-xr-xxlators/experimental/jbr-client/src/gen-fops.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/xlators/experimental/jbr-client/src/gen-fops.py b/xlators/experimental/jbr-client/src/gen-fops.py
index 9893e0c5968..1962d2f8067 100755
--- a/xlators/experimental/jbr-client/src/gen-fops.py
+++ b/xlators/experimental/jbr-client/src/gen-fops.py
@@ -7,7 +7,7 @@ import string
import sys
curdir = os.path.dirname(sys.argv[0])
-gendir = os.path.join(curdir,'../../../../libglusterfs/src')
+gendir = os.path.join(curdir, '../../../../libglusterfs/src')
sys.path.append(gendir)
from generator import ops, fop_subs, cbk_subs, generate
@@ -23,19 +23,19 @@ def load_templates (path):
tmpl_re = re.compile("/\* template-name (.*) \*/")
templates = {}
t_name = None
- for line in open(path,"r").readlines():
+ for line in open(path, "r").readlines():
if not line:
break
m = tmpl_re.match(line)
if m:
if t_name:
- templates[t_name] = string.join(t_contents,'')
+ templates[t_name] = string.join(t_contents, '')
t_name = m.group(1).strip()
t_contents = []
elif t_name:
t_contents.append(line)
if t_name:
- templates[t_name] = string.join(t_contents,'')
+ templates[t_name] = string.join(t_contents, '')
return templates
# Stolen from gen_fdl.py
@@ -44,12 +44,12 @@ def gen_client (templates):
if name == 'getspec':
# It's not real if it doesn't have a stub function.
continue
- print(generate(templates['cbk'],name,cbk_subs))
- print(generate(templates['cont-func'],name,fop_subs))
- print(generate(templates['fop'],name,fop_subs))
+ print(generate(templates['cbk'], name, cbk_subs))
+ print(generate(templates['cont-func'], name, fop_subs))
+ print(generate(templates['fop'], name, fop_subs))
tmpl = load_templates(sys.argv[1])
-for l in open(sys.argv[2],'r').readlines():
+for l in open(sys.argv[2], 'r').readlines():
if l.find('#pragma generate') != -1:
print("/* BEGIN GENERATED CODE - DO NOT MODIFY */")
gen_client(tmpl)