X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FDeleteConfFileFromNode.py;h=53c808c9babdf55066288c1bd9b299523b6b3a4b;hb=156d37f6993517db7fddf9035cf57f1710f75cf8;hp=ac3bbd59bfea3c68841e5f483e15141f1cc4ec2e;hpb=77e4f177dfee85705c36298c3230b2e4a3e73467;p=plcapi.git diff --git a/PLC/Methods/DeleteConfFileFromNode.py b/PLC/Methods/DeleteConfFileFromNode.py index ac3bbd5..53c808c 100644 --- a/PLC/Methods/DeleteConfFileFromNode.py +++ b/PLC/Methods/DeleteConfFileFromNode.py @@ -1,4 +1,3 @@ -# $Id$ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed @@ -26,24 +25,24 @@ class DeleteConfFileFromNode(Method): returns = Parameter(int, '1 if successful') def call(self, auth, conf_file_id, node_id_or_hostname): - # Get configuration file + # Get configuration file conf_files = ConfFiles(self.api, [conf_file_id]) if not conf_files: raise PLCInvalidArgument, "No such configuration file" conf_file = conf_files[0] # Get node - nodes = Nodes(self.api, [node_id_or_hostname]) - if not nodes: - raise PLCInvalidArgument, "No such node" - node = nodes[0] - - # Link configuration file to node + nodes = Nodes(self.api, [node_id_or_hostname]) + if not nodes: + raise PLCInvalidArgument, "No such node" + node = nodes[0] + + # Link configuration file to node if node['node_id'] in conf_file['node_ids']: conf_file.remove_node(node) # Log affected objects - self.event_objects = {'ConfFile': [conf_file_id], - 'Node': [node['node_id']]} + self.event_objects = {'ConfFile': [conf_file_id], + 'Node': [node['node_id']]} return 1