summaryrefslogtreecommitdiffstats
path: root/xlators/experimental/jbr-server
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2018-04-13 09:13:16 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2018-05-02 11:28:46 +0000
commit4e7b423d3c3137c3f83b71b36279e1a544154833 (patch)
treee59dc57aa319a5e145161a0e32fba9fc74773e91 /xlators/experimental/jbr-server
parent9da91172538a2a95fba609c93e199db159fd1938 (diff)
core/various: python3 compat, prepare for python2 -> python3
see https://review.gluster.org/#/c/19788/ use print fn from __future__ Change-Id: If5075d8d9ca9641058fbc71df8a52aa35804cda4 updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/experimental/jbr-server')
-rwxr-xr-xxlators/experimental/jbr-server/src/gen-fops.py39
1 files changed, 20 insertions, 19 deletions
diff --git a/xlators/experimental/jbr-server/src/gen-fops.py b/xlators/experimental/jbr-server/src/gen-fops.py
index 2005e3932d4..e728f473372 100755
--- a/xlators/experimental/jbr-server/src/gen-fops.py
+++ b/xlators/experimental/jbr-server/src/gen-fops.py
@@ -5,6 +5,7 @@
# between leader and followers (including fan-out), and basic error checking
# to be centralized one place, with per-operation code kept to a minimum.
+from __future__ import print_function
import os
import re
import string
@@ -132,49 +133,49 @@ def gen_server (templates):
if ("fsync" in flags) or ("queue" in flags):
flags.append("need_fd")
for fname in flags:
- print "#define JBR_CG_%s" % fname.upper()
+ print("#define JBR_CG_%s" % fname.upper())
if 'complete' in gen_funcs:
- print generate(templates[kind+"-complete"],
- name,cbk_subs)
+ print(generate(templates[kind+"-complete"],
+ name,cbk_subs))
if 'continue' in gen_funcs:
- print generate(templates[kind+"-continue"],
- name,fop_subs)
+ print(generate(templates[kind+"-continue"],
+ name,fop_subs))
if 'fan-in' in gen_funcs:
- print generate(templates[kind+"-fan-in"],
- name,cbk_subs)
+ print(generate(templates[kind+"-fan-in"],
+ name,cbk_subs))
if 'dispatch' in gen_funcs:
- print generate(templates[kind+"-dispatch"],
- name,fop_subs)
+ print(generate(templates[kind+"-dispatch"],
+ name,fop_subs))
if 'call_dispatch' in gen_funcs:
- print generate(templates[kind+"-call_dispatch"],
- name,fop_subs)
+ print(generate(templates[kind+"-call_dispatch"],
+ name,fop_subs))
if 'perform_local_op' in gen_funcs:
- print generate(templates[kind+"-perform_local_op"],
- name, fop_subs)
+ print(generate(templates[kind+"-perform_local_op"],
+ name, fop_subs))
if 'fop' in gen_funcs:
- print generate(templates[kind+"-fop"],name,fop_subs)
+ print(generate(templates[kind+"-fop"],name,fop_subs))
for fname in flags:
- print "#undef JBR_CG_%s" % fname.upper()
+ print("#undef JBR_CG_%s" % fname.upper())
fops_done.append(name)
# Just for fun, emit the fops table too.
print("struct xlator_fops fops = {")
for x in fops_done:
- print(" .%s = jbr_%s,"%(x,x))
+ print((" .%s = jbr_%s,"%(x,x)))
print("};")
tmpl = load_templates(sys.argv[1])
for l in open(sys.argv[2],'r').readlines():
if l.find('#pragma generate') != -1:
- print "/* BEGIN GENERATED CODE - DO NOT MODIFY */"
+ print("/* BEGIN GENERATED CODE - DO NOT MODIFY */")
gen_server(tmpl)
- print "/* END GENERATED CODE */"
+ print("/* END GENERATED CODE */")
else:
- print l[:-1]
+ print(l[:-1])