git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
avoid publishing non-relevant entries in GetVersion
[sfa.git]
/
sfa
/
planetlab
/
peers.py
diff --git
a/sfa/planetlab/peers.py
b/sfa/planetlab/peers.py
index
63c9f7f
..
8c676f3
100644
(file)
--- a/
sfa/planetlab/peers.py
+++ b/
sfa/planetlab/peers.py
@@
-1,5
+1,7
@@
from sfa.util.xrn import get_authority
from sfa.util.xrn import get_authority
-from types import StringTypes
+
+from sfa.util.py23 import StringType
+
def get_peer(pldriver, hrn):
# Because of myplc native federation, we first need to determine if this
def get_peer(pldriver, hrn):
# Because of myplc native federation, we first need to determine if this
@@
-13,16
+15,18
@@
def get_peer(pldriver, 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
# 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 = pldriver.shell.GetPeers( {}, ['peer_id', 'peername', 'shortname', 'hrn_root'])
+ peers = pldriver.shell.GetPeers(
+ {}, ['peer_id', 'peername', 'shortname', 'hrn_root'])
for peer_record in peers:
for peer_record in peers:
- names = [name.lower() for name in peer_record.values() if isinstance(name, StringTypes)]
+ names = [name.lower() for name in peer_record.values()
+ if isinstance(name, StringType)]
if site_authority in names:
peer = peer_record['shortname']
return peer
if site_authority in names:
peer = peer_record['shortname']
return peer
-#def get_sfa_peer(pldriver, hrn):
+#
def get_sfa_peer(pldriver, hrn):
# # return the authority for this hrn or None if we are the authority
# sfa_peer = None
# slice_authority = get_authority(hrn)
# # return the authority for this hrn or None if we are the authority
# sfa_peer = None
# slice_authority = get_authority(hrn)
@@
-32,4
+36,3
@@
def get_peer(pldriver, hrn):
# sfa_peer = site_authority
#
# return sfa_peer
# sfa_peer = site_authority
#
# return sfa_peer
-