X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fplanetlab%2Fpldriver.py;h=5215c57b7cc9cbb20bf5c4034e1e3fced27d547a;hb=e3578cb23c8cd401dbc102f7d674c2dd2aaeaac8;hp=6c88a14fff9d5ff0ae14b6b4161af273c6e3b4ab;hpb=10dd436c0702b4db6d45c33cca6e3d83a84a338b;p=sfa.git diff --git a/sfa/planetlab/pldriver.py b/sfa/planetlab/pldriver.py index 6c88a14f..5215c57b 100644 --- a/sfa/planetlab/pldriver.py +++ b/sfa/planetlab/pldriver.py @@ -27,7 +27,7 @@ from sfa.planetlab.plshell import PlShell import sfa.planetlab.peers as peers from sfa.planetlab.plaggregate import PlAggregate from sfa.planetlab.plslices import PlSlices -from sfa.planetlab.plxrn import PlXrn, slicename_to_hrn, hostname_to_hrn, hrn_to_pl_slicename, xrn_to_hostname +from sfa.planetlab.plxrn import PlXrn, slicename_to_hrn, hostname_to_hrn, hrn_to_pl_slicename, xrn_to_hostname, xrn_to_ext_slicename, top_auth def list_to_dict(recs, key): @@ -773,7 +773,13 @@ class PlDriver (Driver): version=rspec.version) def delete_sliver (self, slice_urn, slice_hrn, creds, options): - slicename = hrn_to_pl_slicename(slice_hrn) + + top_auth_hrn = top_auth(slice_hrn) + if top_auth_hrn == self.hrn: + slicename = hrn_to_pl_slicename(slice_hrn) + else: + slicename = xrn_to_ext_slicename(slice_hrn) + slices = self.shell.GetSlices({'name': slicename}) if not slices: return True @@ -799,7 +805,12 @@ class PlDriver (Driver): return True def renew_sliver (self, slice_urn, slice_hrn, creds, expiration_time, options): - slicename = hrn_to_pl_slicename(slice_hrn) + top_auth_hrn = top_auth(slice_hrn) + if top_auth_hrn == self.hrn: + slicename = hrn_to_pl_slicename(slice_hrn) + else: + slicename = xrn_to_ext_slicename(slice_hrn) + slices = self.shell.GetSlices({'name': slicename}, ['slice_id']) if not slices: raise RecordNotFound(slice_hrn) @@ -814,7 +825,12 @@ class PlDriver (Driver): # remove the 'enabled' tag def start_slice (self, slice_urn, slice_hrn, creds): - slicename = hrn_to_pl_slicename(slice_hrn) + top_auth_hrn = top_auth(slice_hrn) + if top_auth_hrn == self.hrn: + slicename = hrn_to_pl_slicename(slice_hrn) + else: + slicename = xrn_to_ext_slicename(slice_hrn) + slices = self.shell.GetSlices({'name': slicename}, ['slice_id']) if not slices: raise RecordNotFound(slice_hrn) @@ -827,7 +843,12 @@ class PlDriver (Driver): # set the 'enabled' tag to 0 def stop_slice (self, slice_urn, slice_hrn, creds): - slicename = hrn_to_pl_slicename(slice_hrn) + top_auth_hrn = top_auth(slice_hrn) + if top_auth_hrn == self.hrn: + slicename = hrn_to_pl_slicename(slice_hrn) + else: + slicename = xrn_to_ext_slicename(slice_hrn) + slices = self.shell.GetSlices({'name': slicename}, ['slice_id']) if not slices: raise RecordNotFound(slice_hrn)