From: Tony Mack Date: Tue, 10 Oct 2006 21:24:37 +0000 (+0000) Subject: - value returned is now xml-rpc safe X-Git-Tag: pycurl-7_13_1~628 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a1a197680995031d3f1a2565671ec4df4e74dcc0;p=plcapi.git - value returned is now xml-rpc safe --- diff --git a/PLC/Methods/GetKeys.py b/PLC/Methods/GetKeys.py index 609880d4..baabca1f 100644 --- 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