From: Tony Mack Date: Fri, 13 Oct 2006 15:33:02 +0000 (+0000) Subject: - no longer filter out None X-Git-Tag: pycurl-7_13_1~590 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7efd7b86f24e815042c82485acca9e50460a2a83;p=plcapi.git - no longer filter out None --- diff --git a/PLC/Methods/GetNodeNetworks.py b/PLC/Methods/GetNodeNetworks.py index 14cdd48..199f9bd 100644 --- a/PLC/Methods/GetNodeNetworks.py +++ b/PLC/Methods/GetNodeNetworks.py @@ -33,14 +33,11 @@ class GetNodeNetworks(Method): # Get node networks for this node if node['nodenetwork_ids']: - nodenetworks = NodeNetworks(self.api, node['nodenetwork_ids']).values() + nodenetworks = NodeNetworks(self.api, node['nodenetwork_ids']).values() else: - nodenetworks = [] + nodenetworks = [] - # Filter out undesired or None fields (XML-RPC cannot marshal - # None) and turn each node into a real dict. - valid_return_fields_only = lambda (key, value): value is not None - nodenetworks = [dict(filter(valid_return_fields_only, nodenetwork.items())) \ - for nodenetwork in nodenetworks] + # Turn each node into a real dict. + nodenetworks = [dict(nodenetwork.items()) for nodenetwork in nodenetworks] return nodenetworks diff --git a/PLC/Methods/GetPersons.py b/PLC/Methods/GetPersons.py index 3805adc..1e3fa3b 100644 --- a/PLC/Methods/GetPersons.py +++ b/PLC/Methods/GetPersons.py @@ -61,11 +61,7 @@ class GetPersons(Method): # Filter out accounts that are not viewable and turn into list persons = filter(self.caller.can_view, persons.values()) - # Filter out undesired or None fields (XML-RPC cannot marshal - # None) and turn each person into a real dict. - valid_return_fields_only = lambda (key, value): \ - key in return_fields and value is not None - persons = [dict(filter(valid_return_fields_only, person.items())) \ - for person in persons] + # Turn each person into a real dict. + persons = [dict(person.items()) for person in persons] return persons