X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FDeleteConfFileFromNode.py;h=53c808c9babdf55066288c1bd9b299523b6b3a4b;hb=abc6f792c80eb98ab9032a69c526d48efe8075cc;hp=b284c2b6aa6dabf6981e580451f1d40b5e60b6da;hpb=286cdfc25f6ef8fd3e0ed59a175bcf801b14038a;p=plcapi.git diff --git a/PLC/Methods/DeleteConfFileFromNode.py b/PLC/Methods/DeleteConfFileFromNode.py index b284c2b..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