Skip to content

Commit

Permalink
Another fix for property quoting, works with test controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
bentoi committed Nov 23, 2018
1 parent a0d5810 commit 7ce4a86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions scripts/IceGridUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def getEnv(self, current):
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))
Expand Down Expand Up @@ -249,7 +249,7 @@ def setupClientSide(self, current):
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:
Expand Down
10 changes: 4 additions & 6 deletions scripts/Util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -714,7 +712,7 @@ def getProps(self, process, current):
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"
Expand Down

0 comments on commit 7ce4a86

Please sign in to comment.