diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-12-18 21:13:09 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-12-18 21:13:09 +0100 |
commit | aa6809bd9431b5cc3952d6a6e2abde76b2bf003c (patch) | |
tree | 0da37ff519b9a3b6effbd1583b61abbf6f132c2a /scripts | |
parent | http://bugzilla/bugzilla/show_bug.cgi?id=4509 - parallel build issues. (diff) | |
download | ice-aa6809bd9431b5cc3952d6a6e2abde76b2bf003c.tar.bz2 ice-aa6809bd9431b5cc3952d6a6e2abde76b2bf003c.tar.xz ice-aa6809bd9431b5cc3952d6a6e2abde76b2bf003c.zip |
Fixed bug 4511 - properties override doesn't handle quotes
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/IceGridAdmin.py | 32 | ||||
-rwxr-xr-x | scripts/TestUtil.py | 16 |
2 files changed, 34 insertions, 14 deletions
diff --git a/scripts/IceGridAdmin.py b/scripts/IceGridAdmin.py index 49919ceb965..2d14aa89f78 100644 --- a/scripts/IceGridAdmin.py +++ b/scripts/IceGridAdmin.py @@ -8,7 +8,7 @@ # # ********************************************************************** -import sys, os, TestUtil +import sys, os, TestUtil, shlex from threading import Thread # @@ -129,6 +129,26 @@ def shutdownIceGridRegistry(procs): for p in procs: p.waitTestSuccess() +def iceGridNodePropertiesOverride(): + + # + # Create property overrides from command line options. + # + overrideOptions = '' + for opt in shlex.split(TestUtil.getCommandLineProperties("", TestUtil.DriverConfig("server"))): + index = opt.find("=") + if index == -1: + overrideOptions += ("%s=1 ") % opt + else: + key = opt[0:index] + value = opt[index + 1:] + if(value.find(' ') == -1): + overrideOptions += ("%s=%s ") % (key, value) + else: + overrideOptions += ("%s=\\\"%s\\\" ") % (key, value) + + return overrideOptions + def startIceGridNode(testdir): iceGrid = "" @@ -143,15 +163,7 @@ def startIceGridNode(testdir): else: cleanDbDir(dataDir) - # - # Create property overrides from command line options. - # - overrideOptions = '"' - for opt in TestUtil.getCommandLine("", TestUtil.DriverConfig("server")).split(): - opt = opt.replace("--", "") - if opt.find("=") == -1: - opt += "=1" - overrideOptions += opt + " " + overrideOptions = '" ' + iceGridNodePropertiesOverride() overrideOptions += ' Ice.ServerIdleTime=0 Ice.PrintProcessId=0 Ice.PrintAdapterReady=0"' print "starting icegrid node...", diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py index ea4c3c23e88..1352121dcec 100755 --- a/scripts/TestUtil.py +++ b/scripts/TestUtil.py @@ -753,9 +753,9 @@ def argsToDict(argumentString, results): else: results[current] = None return results - -def getCommandLine(exe, config): +def getCommandLineProperties(exe, config): + # # Command lines are built up from the items in the components # sequence, which is initialized with command line options common to @@ -813,6 +813,15 @@ def getCommandLine(exe, config): components.append("%s=%s" % (k, v)) else: components.append("%s" % k) + + output = StringIO.StringIO() + for c in components: + print >>output, c, + properties = output.getvalue() + output.close() + return properties + +def getCommandLine(exe, config): output = StringIO.StringIO() if config.mono and config.lang == "cs": @@ -841,8 +850,7 @@ def getCommandLine(exe, config): else: print >>output, exe, - for c in components: - print >>output, c, + print >>output, getCommandLineProperties(exe, config), commandline = output.getvalue() output.close() |