summaryrefslogtreecommitdiff
path: root/cpp/demo/IceGrid/secure/expect.py
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2012-04-24 14:16:15 -0700
committerMark Spruiell <mes@zeroc.com>2012-04-24 14:16:15 -0700
commit943a48fc5c0a59b892eb746073c71b8dd88815e7 (patch)
tree421cfedbc60603d02e0b314d9204e9f85dd781c5 /cpp/demo/IceGrid/secure/expect.py
parentminor fix to IcePHP getLogger (diff)
downloadice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.bz2
ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.xz
ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.zip
python 3 support
Diffstat (limited to 'cpp/demo/IceGrid/secure/expect.py')
-rwxr-xr-xcpp/demo/IceGrid/secure/expect.py35
1 files changed, 17 insertions, 18 deletions
diff --git a/cpp/demo/IceGrid/secure/expect.py b/cpp/demo/IceGrid/secure/expect.py
index 77feee84f70..0dcf1101caa 100755
--- a/cpp/demo/IceGrid/secure/expect.py
+++ b/cpp/demo/IceGrid/secure/expect.py
@@ -8,7 +8,7 @@
#
# **********************************************************************
-import sys, os
+import sys, os, signal
path = [ ".", "..", "../..", "../../..", "../../../.." ]
head = os.path.dirname(sys.argv[0])
@@ -16,26 +16,25 @@ if len(head) > 0:
path = [os.path.join(head, p) for p in path]
path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ]
if len(path) == 0:
- raise "can't find toplevel directory!"
+ raise RuntimeError("can't find toplevel directory!")
sys.path.append(path[0])
-from demoscript import *
-import signal
+from demoscript import Util
-print "cleaning databases...",
+sys.stdout.write("cleaning databases... ")
sys.stdout.flush()
Util.cleanDbDir("db/master")
Util.cleanDbDir("db/slave")
Util.cleanDbDir("db/node")
Util.cleanDbDir("certs")
-print "ok"
+print("ok")
if Util.defaultHost:
args = ' --IceGrid.Node.PropertiesOverride="Ice.Default.Host=127.0.0.1"'
else:
args = ''
-print "creating certificates...",
+sys.stdout.write("creating certificates... ")
sys.stdout.flush()
makecerts = Util.spawn("python -u makecerts.py")
makecerts.expect("Do you want to keep this as the CA subject name?")
@@ -63,9 +62,9 @@ makecerts.sendline("y")
makecerts.expect("1 out of 1 certificate requests certified, commit?")
makecerts.sendline("y")
makecerts.waitTestSuccess()
-print "ok"
+print("ok")
-print "starting icegrid...",
+sys.stdout.write("starting icegrid... ")
sys.stdout.flush()
masterProps = " --Ice.PrintAdapterReady"
master = Util.spawn(Util.getIceGridRegistry() + ' --Ice.Config=config.master' + masterProps)
@@ -81,18 +80,18 @@ slave.expect('IceGrid.Registry.Client ready')
node = Util.spawn(Util.getIceGridNode() + ' --Ice.Config=config.node --Ice.PrintAdapterReady %s' % (args))
node.expect('IceGrid.Node ready')
-print "ok"
+print("ok")
-print "starting glacier2...",
+sys.stdout.write("starting glacier2... ")
sys.stdout.flush()
glacier2Props = " --Ice.PrintAdapterReady --Glacier2.SessionTimeout=5"
glacier2 = Util.spawn(Util.getGlacier2Router() + ' --Ice.Config=config.glacier2' + glacier2Props)
glacier2.expect('Glacier2.Client ready')
glacier2.expect('Glacier2.Server ready')
-print "ok"
+print("ok")
-print "deploying application...",
+sys.stdout.write("deploying application... ")
sys.stdout.flush()
admin = Util.spawn(Util.getIceGridAdmin() + ' --Ice.Config=config.admin')
admin.expect('>>>')
@@ -100,7 +99,7 @@ admin.sendline("application add application.xml")
admin.expect('>>>')
admin.sendline('exit')
admin.waitTestSuccess(timeout=120)
-print "ok"
+print("ok")
def runtest():
client = Util.spawn('./client')
@@ -115,12 +114,12 @@ def runtest():
client.waitTestSuccess(timeout=1)
-print "testing client...",
+sys.stdout.write("testing client... ")
sys.stdout.flush()
runtest()
-print "ok"
+print("ok")
-print "completing shutdown...",
+sys.stdout.write("completing shutdown... ")
sys.stdout.flush()
admin = Util.spawn(Util.getIceGridAdmin() + ' --Ice.Config=config.admin')
@@ -144,4 +143,4 @@ admin.waitTestSuccess(timeout=120)
glacier2.kill(signal.SIGINT)
glacier2.waitTestSuccess()
-print "ok"
+print("ok")