Skip to content

Commit

Permalink
xenserver: Remove deprecated print statement.
Browse files Browse the repository at this point in the history
PEP 3105 removed the print statement in favour of a print function.
Replace usage of the old statement with equivalent functionality that
works in both python2.7 and python3.

Signed-off-by: Joe Stringer <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
joestringer committed Jun 7, 2016
1 parent fc35b16 commit 561258a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion xenserver/opt_xensource_libexec_InterfaceReconfigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def log(s):
if get_log_destination() == 'syslog':
syslog.syslog(s)
else:
print >>sys.stderr, s
sys.stderr.write(s + '\n')
sys.stderr.flush()

#
# Exceptions.
Expand Down
7 changes: 4 additions & 3 deletions xenserver/opt_xensource_libexec_interface-reconfigure
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def main(argv=None):
elif o == "--no-syslog":
set_log_destination("stderr")
elif o == "-h" or o == "--help":
print __doc__ % {'command-name': os.path.basename(argv[0])}
print(__doc__ % {'command-name': os.path.basename(argv[0])})
return 0

if get_log_destination() == "syslog":
Expand Down Expand Up @@ -714,8 +714,9 @@ def main(argv=None):
db().save(dbcache_file)

except Usage as err:
print >>sys.stderr, err.msg
print >>sys.stderr, "For help use --help."
sys.stderr.write(err.msg + "\n")
sys.stderr.write("For help use --help.\n")
sys.stderr.flush()
return 2
except Error as err:
log(err.msg)
Expand Down

0 comments on commit 561258a

Please sign in to comment.