- def add_slice_attribute_type(self, slice_attribute_type, peer_attribute_type_id, commit = True):
- """
- Associate a local slice attribute type entry with this peer.
- """
-
- add = Row.add_object(SliceAttributeType, 'peer_slice_attribute_type')
- add(self, slice_attribute_type,
- {'peer_id': self['peer_id'],
- 'attribute_type_id': slice_attribute_type['attribute_type_id'],
- 'peer_attribute_type_id': peer_attribute_type_id},
- commit = commit)
-
- def add_slice_attribute(self, slice_attribute, peer_slice_attribute_id, commit = True):
+ 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):