X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=PLC%2FMethods%2FRebootNode.py;h=ed15ce396baa8715d01d630edfe0232402c11a04;hb=da06561d0f5240a5409474e16824e4e015f31fac;hp=bea6b89422aa76e1aebb506de9aab4ff0285a266;hpb=41063c2352286a103b95821293a961f219900f39;p=plcapi.git diff --git a/PLC/Methods/RebootNode.py b/PLC/Methods/RebootNode.py index bea6b89..ed15ce3 100644 --- a/PLC/Methods/RebootNode.py +++ b/PLC/Methods/RebootNode.py @@ -4,7 +4,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Nodes import Node, Nodes -from PLC.NodeNetworks import NodeNetwork, NodeNetworks +from PLC.Interfaces import Interface, Interfaces from PLC.Auth import Auth from PLC.POD import udp_pod @@ -55,10 +55,10 @@ class RebootNode(Method): # Only use the hostname as a backup, try to use the primary ID # address instead. host = node['hostname'] - nodenetworks = NodeNetworks(self.api, node['nodenetwork_ids']) - for nodenetwork in nodenetworks: - if nodenetwork['is_primary'] == 1: - host = nodenetwork['ip'] + interfaces = Interfaces(self.api, node['interface_ids']) + for interface in interfaces: + if interface['is_primary'] == 1: + host = interface['ip'] break try: @@ -67,7 +67,7 @@ class RebootNode(Method): # Ignore socket errors pass - self.event_objects = {'Node': [node['node_id']]} - self.message = "RebootNode called" - + self.event_objects = {'Node': [node['node_id']]} + self.message = "RebootNode called" + return 1