X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fplc%2Fslices.py;h=7a6b514928df7c5d53342fb27cd5e5a6cde3a27d;hb=03a24b3cc26d0f7403809192ba8db4ddd41dde94;hp=28c39fdc8ff263c058dcf548301f40b1b98c312c;hpb=d023266dbd4eea4e1546166e2a9b67a9d61a8489;p=sfa.git diff --git a/sfa/plc/slices.py b/sfa/plc/slices.py index 28c39fdc..7a6b5149 100644 --- a/sfa/plc/slices.py +++ b/sfa/plc/slices.py @@ -184,12 +184,12 @@ 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']) + 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) @@ -227,7 +227,9 @@ class Slices(SimpleStorage): slice['node_ids'] = [] else: slice = slices[0] - slice_id = slice['slice_id'] + 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', [])