From a1a197680995031d3f1a2565671ec4df4e74dcc0 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 10 Oct 2006 21:24:37 +0000 Subject: [PATCH] - value returned is now xml-rpc safe --- PLC/Methods/GetKeys.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.47.0