Skip to content
Snippets Groups Projects
Commit d565f83f authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

rpc_definitions: Add helpers


These helpers will be used to convert incoming parameters to
JSON-compatible types.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 83e7af18
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,14 @@ TMO_1DAY = 86400
SINGLE = "single-node"
MULTI = "multi-node"
OBJECT_TO_DICT = "%s.ToDict()"
OBJECT_LIST_TO_DICT = "map(lambda d: d.ToDict(), %s)"
INST_TO_DICT = "self._InstDict(%s)"
NODE_TO_DISK_DICT = \
("dict((name, %s) for name, disks in %%s.items())" %
(OBJECT_LIST_TO_DICT % "disks"))
CALLS = {
"RpcClientDefault": [
],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment