+ sites = Sites(self.api, node['site_id'], ['login_base'])
+ site = sites[0]
+ login_base = site['login_base']
+ try:
+ # attempt to manually update the 'hrn' tag with the remote prefix
+ hrn_root = self['hrn_root']
+ hrn = hostname_to_hrn(hrn_root, login_base, node['hostname'])
+ tags = {'hrn': hrn}
+ Node(self.api, node).update_tags(tags)
+ except:
+ logger.exception("Could not find out hrn on hostname=%s"%node['hostname'])
+
+ def remove_node(self, node, commit = True):
+ """
+ Unassociate a node with this peer.
+ """
+
+ remove = Row.remove_object(Node, 'peer_node')
+ remove(self, node, commit)
+ # attempt to manually update the 'hrn' tag now that the node is local
+ root_auth = self.api.config.PLC_HRN_ROOT
+ sites = Sites(self.api, node['site_id'], ['login_base'])
+ site = sites[0]
+ login_base = site['login_base']
+ hrn = hostname_to_hrn(root_auth, login_base, node['hostname'])
+ tags = {'hrn': hrn}
+ Node(self.api, node).update_tags(tags)
+