- #!#$! boot manager cannot handle '=' in node keys
[plcapi.git] / PLC / Methods / AddNodeNetwork.py
index a37ce40..34498a6 100644 (file)
@@ -64,6 +64,9 @@ class AddNodeNetwork(Method):
         # Add node network
        nodenetwork = NodeNetwork(self.api, nodenetwork_fields)
         nodenetwork['node_id'] = node['node_id']
+       # if this is the first node network, make it primary
+       if not node['nodenetwork_ids']:
+               nodenetwork['is_primary'] = True
         nodenetwork.sync()
 
        self.object_ids = [node['node_id'], nodenetwork['nodenetwork_id']]