From: Anil-Kumar Vengalil Date: Wed, 19 Aug 2009 18:16:42 +0000 (+0000) Subject: bug fix in binding person to a site X-Git-Tag: sfa-0.9-1~62 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=03a24b3cc26d0f7403809192ba8db4ddd41dde94;p=sfa.git bug fix in binding person to a site --- diff --git a/sfa/plc/slices.py b/sfa/plc/slices.py index 1bfd3503..7a6b5149 100644 --- a/sfa/plc/slices.py +++ b/sfa/plc/slices.py @@ -185,11 +185,11 @@ class Slices(SimpleStorage): # Make sure slice exists at plc, if it doesnt add it slicename = hrn_to_pl_slicename(hrn) slices = self.api.plshell.GetSlices(self.api.plauth, [slicename], ['slice_id', 'node_ids', 'site_id'] ) + parts = slicename.split("_") + login_base = parts[0] + # if site doesnt exist add it + sites = self.api.plshell.GetSites(self.api.plauth, [login_base]) if not slices: - parts = slicename.split("_") - login_base = parts[0] - # if site doesnt exist add it - sites = self.api.plshell.GetSites(self.api.plauth, [login_base]) if not sites: authority = get_authority(hrn) site_records = registry.resolve(credential, authority) @@ -229,6 +229,7 @@ class Slices(SimpleStorage): slice = slices[0] slice_id = slice['slice_id'] site_id = slice['site_id'] + remote_site_id = sites[0]['peer_site_id'] # get the list of valid slice users from the registry and make # they are added to the slice researchers = record.get('researcher', [])