topology.py moved in sfa/plc/
[sfa.git] / sfa / plc / peers.py
index 8a699e7..f9f80db 100644 (file)
@@ -1,7 +1,8 @@
-from sfa.util.misc import *
+from sfa.util.xrn import get_authority
+from types import StringTypes
 
 def get_peer(api, hrn):
-    # Becaues of myplc federation,  we first need to determine if this
+    # Because of myplc native federation,  we first need to determine if this
     # 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
@@ -12,8 +13,7 @@ def get_peer(api, 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.api.plshell.GetPeers(self.api.plauth, {}, \
-                    ['peer_id', 'peername', 'shortname', 'hrn_root'])
+    peers = api.driver.GetPeers( {}, ['peer_id', 'peername', 'shortname', 'hrn_root'])
     for peer_record in peers:
         names = [name.lower() for name in peer_record.values() if isinstance(name, StringTypes)]
         if site_authority in names: