From: Mark Huang Date: Mon, 6 Nov 2006 18:25:08 +0000 (+0000) Subject: - Boot Manager cannot marshal None X-Git-Tag: pycurl-7_13_1~380 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=16bdca3605e0eb8075b71c70b0c9bd2b5268db95;p=plcapi.git - Boot Manager cannot marshal None --- diff --git a/PLC/Methods/BootGetNodeDetails.py b/PLC/Methods/BootGetNodeDetails.py index b616b5af..e0775766 100644 --- a/PLC/Methods/BootGetNodeDetails.py +++ b/PLC/Methods/BootGetNodeDetails.py @@ -27,7 +27,8 @@ class BootGetNodeDetails(Method): details = { 'hostname': self.caller['hostname'], 'boot_state': self.caller['boot_state'], - 'model': self.caller['model'], + # XXX Boot Manager cannot unmarshal None + 'model': self.caller['model'] or "", } # Generate a new session value @@ -39,6 +40,14 @@ class BootGetNodeDetails(Method): if self.caller['nodenetwork_ids']: details['networks'] = NodeNetworks(self.api, self.caller['nodenetwork_ids']).values() + # XXX Boot Manager cannot unmarshal None + for network in details['networks']: + for field in network: + if network[field] is None: + if isinstance(network[field], (int, long)): + network[field] = -1 + else: + network[field] = "" return details