Merge branch 'master' into senslab2
[sfa.git] / sfa / planetlab / plslices.py
index 30e9797..2de659e 100644 (file)
@@ -1,5 +1,6 @@
 from types import StringTypes
 from collections import defaultdict
+import sys
 
 from sfa.util.sfatime import utcparse, datetime_to_epoch
 from sfa.util.sfalogging import logger
@@ -132,13 +133,11 @@ class PlSlices:
         # slice belongs to out local plc or a myplc peer. We will assume it 
         # is a local site, unless we find out otherwise  
         peer = None
-
         # get this slice's authority (site)
         slice_authority = get_authority(hrn)
 
         # get this site's authority (sfa root authority or sub authority)
         site_authority = get_authority(slice_authority).lower()
-
         # check if we are already peered with this site_authority, if so
         peers = self.driver.shell.GetPeers({}, ['peer_id', 'peername', 'shortname', 'hrn_root'])
         for peer_record in peers:
@@ -172,6 +171,9 @@ class PlSlices:
              slice_name = hrn_to_pl_slicename(lease['slice_id'])
              if slice_name != slice['name']:
                  continue
+             elif Xrn(lease['component_id']).get_authority_urn().split(':')[0] != self.driver.hrn:
+                 continue
+
              hostname = xrn_to_hostname(lease['component_id'])
              # fill the requested node with nitos ids
              requested_lease['name'] = slice['name']