git://git.onelab.eu
/
tests.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more macros
[tests.git]
/
system
/
tcptest.py
diff --git
a/system/tcptest.py
b/system/tcptest.py
index
773ecbe
..
abdc6fb
100755
(executable)
--- a/
system/tcptest.py
+++ b/
system/tcptest.py
@@
-3,6
+3,14
@@
# Thierry Parmentelat <thierry.parmentelat@inria.fr>
# Copyright (C) 2010 INRIA
#
# Thierry Parmentelat <thierry.parmentelat@inria.fr>
# Copyright (C) 2010 INRIA
#
+
+# this is a small and simple standalone utility
+# designed to run in slice-space
+# we keep this in python2 for now until python3
+# can be taken for granted in sliceimage
+
+from __future__ import print_function
+
import sys
import time
import subprocess
import sys
import time
import subprocess
@@
-13,7
+21,7
@@
from optparse import OptionParser
def myprint(message, id='client'):
now = time.strftime("%H:%M:%S", time.localtime())
def myprint(message, id='client'):
now = time.strftime("%H:%M:%S", time.localtime())
- print
"* {now} ({id}) -- {message}".format(**locals(
))
+ print
("* {now} ({id}) -- {message}".format(**locals()
))
sys.stdout.flush()
def show_network_status(id):
sys.stdout.flush()
def show_network_status(id):
@@
-64,7
+72,7
@@
class Server:
else:
server.serve_forever()
except KeyboardInterrupt as e:
else:
server.serve_forever()
except KeyboardInterrupt as e:
- print
'Bailing out on keyboard interrupt'
+ print
('Bailing out on keyboard interrupt')
sys.exit(1)
class Ready:
sys.exit(1)
class Ready:
@@
-90,7
+98,7
@@
class Ready:
s.bind((options.address, options.port))
return True
except Exception as e:
s.bind((options.address, options.port))
return True
except Exception as e:
- print
e
+ print
(e)
return False
def eth0_has_ipv4():
return False
def eth0_has_ipv4():
@@
-158,5
+166,5
@@
if __name__ == '__main__':
elif arg.find("ready") >= 0:
sys.argv.remove(arg)
Ready().main()
elif arg.find("ready") >= 0:
sys.argv.remove(arg)
Ready().main()
- print
'you must specify either --client or --server'
+ print
('you must specify either --client or --server')
sys.exit(1)
sys.exit(1)