diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2018-07-02 08:18:54 -0400 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-07-09 03:38:36 +0000 |
commit | 55d1b0531a0b322a1b851fc921fd6fdf25d26331 (patch) | |
tree | f3d8c84e4d27fb8894a9c921a9a4ed06257cf80e /xlators/experimental/jbr-client | |
parent | dab12ce093628860bf43c3e0c7eaf9099cf7a78f (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/,
https://review.gluster.org/#/c/20332/, and
https://review.gluster.org/#/c/20364/
Fixes glupy.py python2isms, iteritems -> items, and some overlooked
print() in georep/peer_mountbroker.in
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: Idda031c1ec975417c79323aea33e7b694e752b2a
updates: #411
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/experimental/jbr-client')
-rwxr-xr-x | xlators/experimental/jbr-client/src/gen-fops.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/experimental/jbr-client/src/gen-fops.py b/xlators/experimental/jbr-client/src/gen-fops.py index 1962d2f8067..47b339910d4 100755 --- a/xlators/experimental/jbr-client/src/gen-fops.py +++ b/xlators/experimental/jbr-client/src/gen-fops.py @@ -14,7 +14,7 @@ from generator import ops, fop_subs, cbk_subs, generate # We really want the callback argument list, even when we're generating fop # code, so we propagate here. # TBD: this should probably be right in generate.py -for k, v in cbk_subs.iteritems(): +for k, v in cbk_subs.items(): fop_subs[k]['@ERROR_ARGS@'] = v['@ERROR_ARGS@'] # Stolen from old codegen.py @@ -29,18 +29,18 @@ def load_templates (path): m = tmpl_re.match(line) if m: if t_name: - templates[t_name] = string.join(t_contents, '') + templates[t_name] = ''.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] = ''.join(t_contents) return templates # Stolen from gen_fdl.py def gen_client (templates): - for name, value in ops.iteritems(): + for name, value in ops.items(): if name == 'getspec': # It's not real if it doesn't have a stub function. continue |