from PLC.Sites import Site, Sites
from PLC.Auth import Auth
+from PLC.Methods.AddSiteTag import AddSiteTag
+
can_update = lambda (field, value): field in \
['name', 'abbreviated_name', 'login_base',
'is_public', 'latitude', 'longitude', 'url',
self.event_objects = {'Site': [site['site_id']]}
self.message = 'Site %d created' % site['site_id']
+ # Set Site HRN
+ root_auth = self.api.config.PLC_HRN_ROOT
+ tagname = 'hrn'
+ tagvalue = '.'.join([root_auth, site['login_base']])
+ AddSiteTag(self.api).__call__(auth,site['site_id'],tagname,tagvalue)
+
+
return site['site_id']
slice['site_id'] = site['site_id']
slice.sync()
+ # Set Slice HRN
+ root_auth = self.api.config.PLC_HRN_ROOT
+ tags['hrn'] = '.'.join([root_auth, login_base, name.split("_")[1]])
+
for (tagname,value) in tags.iteritems():
# the tagtype instance is assumed to exist, just check that
if not TagTypes(self.api,{'tagname':tagname}):