git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8adb780
)
- value returned is now xml-rpc safe
author
Tony Mack
<tmack@cs.princeton.edu>
Tue, 10 Oct 2006 21:24:37 +0000
(21:24 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Tue, 10 Oct 2006 21:24:37 +0000
(21:24 +0000)
PLC/Methods/GetKeys.py
patch
|
blob
|
history
diff --git
a/PLC/Methods/GetKeys.py
b/PLC/Methods/GetKeys.py
index
609880d
..
baabca1
100644
(file)
--- a/
PLC/Methods/GetKeys.py
+++ b/
PLC/Methods/GetKeys.py
@@
-33,5
+33,10
@@
class GetKeys(Method):
key_id_list = filter(valid_keys, key_id_list)
keys = Keys(self.api, key_id_list).values()
-
+
+ # Filter out undesired or None fields (XML-RPC cannot marshal
+ # None) and turn each key into a real dict.
+ valid_return_fields_only = lambda (key, value): value is not None
+ keys = [dict(filter(valid_return_fields_only, key.items())) \
+ for key in keys]
return keys