X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FPeers.py;h=e78f568dcd2236cfbdb2cc72c1e97594626969ea;hb=b4b902d85a7966403dc09cc1c3f0da8a07b7a1e9;hp=b2cb7387f5c675dc08190844a343b2a3ac7cfa05;hpb=2e1a54e6ba7ec6db22ad98342acaa943ca83c13e;p=plcapi.git diff --git a/PLC/Peers.py b/PLC/Peers.py index b2cb738..e78f568 100644 --- a/PLC/Peers.py +++ b/PLC/Peers.py @@ -13,7 +13,7 @@ from PLC.Parameter import Parameter, Mixed from PLC.Filter import Filter from PLC.Table import Row, Table import PLC.Auth - +from PLC.Shell import * from PLC.Sites import Site, Sites from PLC.Persons import Person, Persons from PLC.Keys import Key, Keys @@ -164,6 +164,13 @@ class Peer(Row): 'peer_node_id': peer_node_id}, commit = commit) + # calling UpdateNode with the node's hostname + # will force the 'hrn' tag to be updated with the + # correct root auth + shell = Shell() + UpdateNode = self.api.callable('UpdateNode') + UpdateNode(shell.auth, node['node_id'], {'hostname': node['hostname']}) + def remove_node(self, node, commit = True): """ Unassociate a node with this peer. @@ -171,6 +178,8 @@ class Peer(Row): remove = Row.remove_object(Node, 'peer_node') remove(self, node, commit) + UpdateNode = self.api.callable('UpdateNode') + UpdateNode(shell.auth, node['node_id'], {'hostname': node['hostname']}) def add_slice(self, slice, peer_slice_id, commit = True): """