Fix calls of the print function

Apparently it seems that in some places of the os-ken we still had
called 'print' funtion in the "python 2 way". This is cached by the
'debug-statements' hook in the pre-commit script so to make it happy
this patch fixes those print calls.

TrivialFix

Change-Id: Iac1f35b6875005b9562ff12511d442f1484d81e5
This commit is contained in:
Slawek Kaplonski 2024-05-06 12:34:13 +02:00
parent b1bc75dec6
commit a4e10d3d0b
3 changed files with 16 additions and 16 deletions

View File

@ -24,4 +24,4 @@ import sys
j = sys.stdin.read() j = sys.stdin.read()
d = json.loads(j) d = json.loads(j)
print json.dumps(d, ensure_ascii=True, indent=3, sort_keys=True) print(json.dumps(d, ensure_ascii=True, indent=3, sort_keys=True))

View File

@ -83,15 +83,15 @@ def is_leaf(s):
def generate_header(ctx): def generate_header(ctx):
print _COPYRIGHT_NOTICE print(_COPYRIGHT_NOTICE)
print '# do not edit.' print('# do not edit.')
print '# this file was mechanically generated with:' print('# this file was mechanically generated with:')
print '# pyang %s' % pyang.__version__ print('# pyang %s' % pyang.__version__)
print '# os_ken.tools.pyang_plugins.osken' print('# os_ken.tools.pyang_plugins.osken')
for mod, ver in sorted(ctx.modules): for mod, ver in sorted(ctx.modules):
print '# %s@%s' % (mod, ver) print('# %s@%s' % (mod, ver))
print '' print('')
print 'from os_ken.lib.of_config.base import _Base, _e, _ct' print('from os_ken.lib.of_config.base import _Base, _e, _ct')
def generate_class_def(s): def generate_class_def(s):
@ -122,8 +122,8 @@ def _generate_class_def(s):
def generate_class(s): def generate_class(s):
print '' print('')
print '' print('')
sys.stdout.write(generate_class_def(s)) sys.stdout.write(generate_class_def(s))

View File

@ -25,9 +25,9 @@ import sys
j = sys.stdin.read() j = sys.stdin.read()
l = json.loads(j) l = json.loads(j)
print 'digraph {' print('digraph {')
print 'node [shape=box]' print('node [shape=box]')
for d in l: for d in l:
print '"%s" -> "%s";' % (d['src']['dpid'], d['dst']['dpid']) print('"%s" -> "%s";' % (d['src']['dpid'], d['dst']['dpid']))
print 'overlap=false' print('overlap=false')
print '}' print('}')