This commit was manufactured by cvs2svn to create branch
[plcapi.git] / PLC / Methods / BootGetNodeDetails.py
index b616b5a..2f5056d 100644 (file)
@@ -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
@@ -38,7 +39,17 @@ class BootGetNodeDetails(Method):
         details['session'] = session['session_id']
 
         if self.caller['nodenetwork_ids']:
-            details['networks'] = NodeNetworks(self.api, self.caller['nodenetwork_ids']).values()
-
+            details['networks'] = NodeNetworks(self.api, self.caller['nodenetwork_ids'])
+            # 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] = ""
+
+       self.messge = "Node request boot_state (%s) and networks" % \
+               (details['boot_state'])
         return details