Commit 9049532a authored by Leigh Stoller's avatar Leigh Stoller

Minor change so that I can feed dictionaries on the command line, as

would be required to use delay_config or link_config. For example:

	sshxmlrpc_client.py link_config proj=testbed exp=two-wireless \
		link=lan0 "params={'a': 4}"

Note last argument, which is eval'ed into a dictionary before it is
sent across in the RPC. This is done whenever first character of the
value is a "{" ... otherwise it is treated as a literal.
parent 580a9596
......@@ -101,8 +101,17 @@ def do_method(server, method_and_args):
if len(plist) != 2:
print "Parameters are of the form: param=value!"
return -1
value = plist[1]
#
# If the first character of the argument looks like a dictionary,
# try to evaluate it.
#
if value[0] == "{":
value = eval(value);
pass
params[plist[0]] = plist[1]
params[plist[0]] = value
pass
meth_args = [ PACKAGE_VERSION, params ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment