diff options
author | Benoit Foucher <benoit@zeroc.com> | 2018-11-23 11:54:40 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2018-11-23 11:54:40 +0100 |
commit | 7ce4a86b5668c25effd0cbf9893a653a4c07bf93 (patch) | |
tree | c962d35ef67b4554c0e3e9b97b6640fe4e184d87 | |
parent | Fix quote issue from previous IPv6 testing fix (diff) | |
download | ice-7ce4a86b5668c25effd0cbf9893a653a4c07bf93.tar.bz2 ice-7ce4a86b5668c25effd0cbf9893a653a4c07bf93.tar.xz ice-7ce4a86b5668c25effd0cbf9893a653a4c07bf93.zip |
Another fix for property quoting, works with test controllers
-rw-r--r-- | scripts/IceGridUtil.py | 4 | ||||
-rw-r--r-- | scripts/Util.py | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/scripts/IceGridUtil.py b/scripts/IceGridUtil.py index 0c2ad2f838c..a0e4e49217f 100644 --- a/scripts/IceGridUtil.py +++ b/scripts/IceGridUtil.py @@ -112,7 +112,7 @@ class IceGridNode(ProcessFromBinDir, Server): def getPropertiesOverride(self, current): # Add properties for servers based on the test case mapping. props = Server().getEffectiveProps(current, {}) - return ' '.join(["{0}={1}".format(k, val(v, escapeQuotes=True)) for k, v in props.items()]) + return ' '.join(["{0}={1}".format(k, val(v)) for k, v in props.items()]) def shutdown(self, current): current.testcase.runadmin(current, "node shutdown {0}".format(self.name)) @@ -249,7 +249,7 @@ class IceGridTestCase(TestCase): variables[k] = current.getBuildDir(v) variables.update(self.variables) - varStr = " ".join(["{0}={1}".format(k, val(v, True)) for k,v in variables.items()]) + varStr = " ".join(["{0}={1}".format(k, val(v)) for k,v in variables.items()]) targets = " ".join(self.targets) application = self.application if isinstance(self.mapping, CSharpMapping) and current.config.dotnetcore: diff --git a/scripts/Util.py b/scripts/Util.py index 8bb4334b26b..e913a5f3c89 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -54,16 +54,14 @@ def run(cmd, cwd=None, err=False, stdout=False, stdin=None, stdinRepeat=True): pass return out -def val(v, escapeQuotes=False, quoteValue=True): +def val(v, quoteValue=True): if type(v) == bool: return "1" if v else "0" elif type(v) == str: if not quoteValue or v.find(" ") < 0: return v - elif escapeQuotes: - return "\\\"{0}\\\"".format(v.replace("\\\"", "\\\\\\\"")) - else: - return "\"{0}\"".format(v) + v = v.replace("\\", "\\\\").replace("\"", "\\\"") + return "\"{0}\"".format(v) else: return str(v) @@ -714,7 +712,7 @@ class Mapping(object): if self.ipv6: props["Ice.PreferIPv6Address"] = True if self.mx: - props["Ice.Admin.Endpoints"] = "tcp -h \\\"::1\\\"" if self.ipv6 else "tcp -h 127.0.0.1" + props["Ice.Admin.Endpoints"] = "tcp -h \"::1\"" if self.ipv6 else "tcp -h 127.0.0.1" props["Ice.Admin.InstanceName"] = "Server" if isinstance(process, Server) else "Client" props["IceMX.Metrics.Debug.GroupBy"] ="id" props["IceMX.Metrics.Parent.GroupBy"] = "parent" |