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
removed another bunch of references to geni
[sfa.git]
/
sfa
/
server
/
sfa-clean-peer-records.py
diff --git
a/sfa/server/sfa-clean-peer-records.py
b/sfa/server/sfa-clean-peer-records.py
index
635b114
..
5c13335
100644
(file)
--- a/
sfa/server/sfa-clean-peer-records.py
+++ b/
sfa/server/sfa-clean-peer-records.py
@@
-2,14
+2,17
@@
import sys
import os
import sys
import os
-from sfa.util.misc import *
-from sfa.util.
genitable import GeniTable
-from sfa.util.
geniclient import GeniClient
-from sfa.plc.api import
Geni
API
+import traceback
+from sfa.util.
namespace import *
+from sfa.util.
table import SfaTable
+from sfa.plc.api import
Sfa
API
from sfa.util.config import Config
from sfa.util.config import Config
+from sfa.trust.certificate import Keypair
from sfa.trust.hierarchy import Hierarchy
from sfa.util.report import trace, error
from sfa.server.registry import Registries
from sfa.trust.hierarchy import Hierarchy
from sfa.util.report import trace, error
from sfa.server.registry import Registries
+from sfa.util.xmlrpcprotocol import xmlrpcprotocol, ServerException
+import socket
def main():
config = Config()
def main():
config = Config()
@@
-22,31
+25,34
@@
def main():
sfa_key_path = sfa_hierarchy.basedir
key_file = os.path.join(sfa_key_path, "server.key")
cert_file = os.path.join(sfa_key_path, "server.cert")
sfa_key_path = sfa_hierarchy.basedir
key_file = os.path.join(sfa_key_path, "server.key")
cert_file = os.path.join(sfa_key_path, "server.cert")
+ key = Keypair(filename=key_file)
# get a connection to our local sfa registry
# and a valid credential
authority = config.SFA_INTERFACE_HRN
url = 'http://%s:%s/' %(config.SFA_REGISTRY_HOST, config.SFA_REGISTRY_PORT)
# get a connection to our local sfa registry
# and a valid credential
authority = config.SFA_INTERFACE_HRN
url = 'http://%s:%s/' %(config.SFA_REGISTRY_HOST, config.SFA_REGISTRY_PORT)
- registry =
GeniClient
(url, key_file, cert_file)
- sfa_api =
Geni
API(key_file = key_file, cert_file = cert_file, interface='registry')
+ registry =
xmlrpcprotocol.get_server(
(url, key_file, cert_file)
+ sfa_api =
Sfa
API(key_file = key_file, cert_file = cert_file, interface='registry')
credential = sfa_api.getCredential()
# get peer registries
registries = Registries(sfa_api)
credential = sfa_api.getCredential()
# get peer registries
registries = Registries(sfa_api)
-
# get local peer records
# get local peer records
- table =
Geni
Table()
+ table =
Sfa
Table()
peer_records = table.find({'~peer_authority': None})
for peer_record in peer_records:
peer_auth = peer_record['peer_authority']
if peer_auth in registries:
try:
peer_records = table.find({'~peer_authority': None})
for peer_record in peer_records:
peer_auth = peer_record['peer_authority']
if peer_auth in registries:
try:
- records = registries[peer_auth].resolve(credential, peer_record['hrn'])
- except:
+ peer_record_hrn = peer_record['hrn']
+ arg_list = [credential, peer_record_hrn]
+ records = registries[peer_auth].resolve(credential, peer_record_hrn)
+ except ServerException:
# an exception will be thrown if the record doenst exist
# if so remove the record from the local registry
registries[sfa_api.hrn].remove_peer_object(credential, peer_record)
# an exception will be thrown if the record doenst exist
# if so remove the record from the local registry
registries[sfa_api.hrn].remove_peer_object(credential, peer_record)
-
+ except:
+ traceback.print_exc()
if __name__ == '__main__':
main()
if __name__ == '__main__':
main()