def verify_site(self, slice_xrn, slice_record={}, sfa_peer=None, options={}):
- #(slice_hrn, type) = urn_to_hrn(slice_xrn)
- #top_auth_hrn = top_auth(slice_hrn)
- #site_hrn = '.'.join(slice_hrn.split('.')[:-1])
- #if top_auth_hrn == self.driver.hrn:
- # login_base = slice_hrn.split('.')[-2][:12]
- #else:
- # login_base = hash_loginbase(site_hrn)
- plxrn = PlXrn(xrn=slice_xrn)
- slice_hrn = plxrn.get_hrn()
- type = plxrn.get_type()
- site_hrn = plxrn.get_authority_hrn()
- authority_name = plxrn.pl_authname()
- slicename = plxrn.pl_slicename()
- login_base = plxrn.pl_login_base()
+ (slice_hrn, type) = urn_to_hrn(slice_xrn)
+ top_auth_hrn = top_auth(slice_hrn)
+ site_hrn = '.'.join(slice_hrn.split('.')[:-1])
+ if top_auth_hrn == self.driver.hrn:
+ login_base = slice_hrn.split('.')[-2][:12]
+ else:
+ login_base = hash_loginbase(site_hrn)
+ #plxrn = PlXrn(xrn=slice_xrn)
+ #slice_hrn = plxrn.get_hrn()
+ #type = plxrn.get_type()
+ #site_hrn = plxrn.get_authority_hrn()
+ #authority_name = plxrn.pl_authname()
+ #slicename = plxrn.pl_slicename()
+ #login_base = plxrn.pl_login_base()
sites = self.driver.shell.GetSites({'peer_id': None},['site_id','name','abbreviated_name','login_base','hrn'])
def verify_slice(self, slice_hrn, slice_record, sfa_peer, expiration, options={}):
- #top_auth_hrn = top_auth(slice_hrn)
- #site_hrn = '.'.join(slice_hrn.split('.')[:-1])
- #slice_part = slice_hrn.split('.')[-1]
- #if top_auth_hrn == self.driver.hrn:
- # login_base = slice_hrn.split('.')[-2][:12]
- #else:
- # login_base = hash_loginbase(site_hrn)
- #slice_name = '_'.join([login_base, slice_part])
- plxrn = PlXrn(xrn=slice_hrn)
- slice_hrn = plxrn.get_hrn()
- type = plxrn.get_type()
- site_hrn = plxrn.get_authority_hrn()
- authority_name = plxrn.pl_authname()
- slicename = plxrn.pl_slicename()
- login_base = plxrn.pl_login_base()
+ top_auth_hrn = top_auth(slice_hrn)
+ site_hrn = '.'.join(slice_hrn.split('.')[:-1])
+ slice_part = slice_hrn.split('.')[-1]
+ if top_auth_hrn == self.driver.hrn:
+ login_base = slice_hrn.split('.')[-2][:12]
+ else:
+ login_base = hash_loginbase(site_hrn)
+ slice_name = '_'.join([login_base, slice_part])
+ #plxrn = PlXrn(xrn=slice_hrn)
+ #slice_hrn = plxrn.get_hrn()
+ #type = plxrn.get_type()
+ #site_hrn = plxrn.get_authority_hrn()
+ #authority_name = plxrn.pl_authname()
+ #slicename = plxrn.pl_slicename()
+ #login_base = plxrn.pl_login_base()
slices = self.driver.shell.GetSlices({'peer_id': None},['slice_id','name','hrn'])
# Filter slices by HRN