- support signing XML-RPC methodResponses as well (for GetSliceTicket())
[plcapi.git] / PLC / Methods / AddNodeToNodeGroup.py
index 336387b..6829daf 100644 (file)
@@ -32,7 +32,9 @@ class AddNodeToNodeGroup(Method):
        if not nodes:
                raise PLCInvalidArgument, "No such node"
        node = nodes[0]
-       PLCCheckLocalNode (node,"AddNodeToNodeGroup")
+
+        if node['peer_id'] is not None:
+            raise PLCInvalidArgument, "Not a local node"
 
        # Get nodegroup info
         nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
@@ -44,6 +46,9 @@ class AddNodeToNodeGroup(Method):
        # add node to nodegroup
         if node['node_id'] not in nodegroup['node_ids']:
             nodegroup.add_node(node)
+       
+       # Logging variables
        self.object_ids = [nodegroup['nodegroup_id']]
-
+       self.message = 'Node %d added to node group %d' % \
+               (node['node_id'], nodegroup['nodegroup_id'])
         return 1