fix for smooth federation between 4.2 and 4.3
[plcapi.git] / PLC / Nodes.py
index f25a617..8e06fad 100644 (file)
@@ -49,7 +49,6 @@ class Node(Row):
         'site_id': Parameter(int, "Site at which this node is located"),
         'boot_state': Parameter(str, "Boot state", max = 20),
         'run_level': Parameter(str, "Run level", max = 20),
-        'extrainfo': Parameter(str, "Extra information about the host", max = 256),
         'model': Parameter(str, "Make and model of the actual machine", max = 255, nullok = True),
         'boot_nonce': Parameter(str, "(Admin only) Random value generated by the node at last boot", max = 128),
         'version': Parameter(str, "Apparent Boot CD version", max = 64),
@@ -248,11 +247,15 @@ class Node(Row):
         """
 
         assert 'node_id' in self
-       assert 'interface_ids' in self
 
        # we need to clean up InterfaceTags, so handling interfaces as part of join_tables does not work
-       for interface in Interfaces(self.api,self['interface_ids']):
-           interface.delete()
+        # federated nodes don't have interfaces though so for smooth transition from 4.2 to 4.3
+        if 'peer_id' in self and self['peer_id']:
+            pass
+        else:
+            assert 'interface_ids' in self
+            for interface in Interfaces(self.api,self['interface_ids']):
+                interface.delete()
 
         # Clean up miscellaneous join tables
         for table in self.join_tables: