summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/gen-defaults.py
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2018-06-22 06:19:53 -0400
committerShyamsundar Ranganathan <srangana@redhat.com>2018-06-23 14:12:04 +0000
commit69b8ade6168d1b5a96323e3b656273375d2aff7b (patch)
treee69ba4f12ef36c2a1a9e3811f964b3b7cc4eec41 /libglusterfs/src/gen-defaults.py
parent8a7e70a221778cd54c8bda9d6c2a522511d36ed1 (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/, https://review.gluster.org/#/c/20320/, and https://review.gluster.org/#/c/20332/ This patch fixes the remaining 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: If5aca67084a7b1c06966fed35fb35e8bb2f7d67c updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'libglusterfs/src/gen-defaults.py')
-rw-r--r--libglusterfs/src/gen-defaults.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/libglusterfs/src/gen-defaults.py b/libglusterfs/src/gen-defaults.py
index e577eb71863..ccd5f5fc6c9 100644
--- a/libglusterfs/src/gen-defaults.py
+++ b/libglusterfs/src/gen-defaults.py
@@ -62,17 +62,17 @@ default_@NAME@ (
def gen_defaults ():
for name in ops.iterkeys():
- print(generate(FAILURE_CBK_TEMPLATE,name,cbk_subs))
+ print(generate(FAILURE_CBK_TEMPLATE, name, cbk_subs))
for name in ops.iterkeys():
- print(generate(CBK_RESUME_TEMPLATE,name,cbk_subs))
+ print(generate(CBK_RESUME_TEMPLATE, name, cbk_subs))
for name in ops.iterkeys():
- print(generate(CBK_TEMPLATE,name,cbk_subs))
+ print(generate(CBK_TEMPLATE, name, cbk_subs))
for name in ops.iterkeys():
- print(generate(RESUME_TEMPLATE,name,fop_subs))
+ print(generate(RESUME_TEMPLATE, name, fop_subs))
for name in ops.iterkeys():
- print(generate(FOP_TEMPLATE,name,fop_subs))
+ print(generate(FOP_TEMPLATE, name, fop_subs))
-for l in open(sys.argv[1],'r').readlines():
+for l in open(sys.argv[1], 'r').readlines():
if l.find('#pragma generate') != -1:
print("/* BEGIN GENERATED CODE - DO NOT MODIFY */")
gen_defaults()