peer x foreign_node relationship in a separate peer_node table -- uses new db interface
[plcapi.git] / PLC / Methods / BootUpdateNode.py
index e612bdf..31dbb37 100644 (file)
@@ -17,6 +17,8 @@ class BootUpdateNode(Method):
     Returns 1 if updated successfully.
     """
 
+    roles = ['node']
+
     nodenetwork_fields = dict(filter(can_update, NodeNetwork.fields.items()))
 
     accepts = [
@@ -25,6 +27,7 @@ class BootUpdateNode(Method):
          'primary_network': nodenetwork_fields,
          'ssh_host_key': Node.fields['ssh_rsa_key']}
         ]
+
     returns = Parameter(int, '1 if successful')
 
     def call(self, auth, node_fields):
@@ -43,7 +46,7 @@ class BootUpdateNode(Method):
             if primary_network['nodenetwork_id'] not in self.caller['nodenetwork_ids']:
                 raise PLCInvalidArgument, "Node network not associated with calling node"
 
-            nodenetworks = NodeNetworks(self.api, [primary_network['nodenetwork_id']]).values()
+            nodenetworks = NodeNetworks(self.api, [primary_network['nodenetwork_id']])
             if not nodenetworks:
                 raise PLCInvalidArgument, "No such node network"
             nodenetwork = nodenetworks[0]