From c709d60e154c923ae5386c503f51031c161d344a Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Tue, 6 Jan 2009 06:20:13 +0000 Subject: [PATCH] fix missing module imports --- plc/plc.py | 5 +++-- plc/registry.py | 16 ++++++++++------ plc/slicemgr.py | 2 ++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/plc/plc.py b/plc/plc.py index 1c7f38de..013ef53e 100644 --- a/plc/plc.py +++ b/plc/plc.py @@ -14,7 +14,7 @@ # appropriate geni records. This is done by running the "import.py" tool. # # 3) Create a "trusted_roots" directory and place the certificate of the root -# authority in that directory. Given the defaults in import.py, this +# authority in that directory. Given the defaults in import.py, this # certificate would be named "planetlab.gid". For example, # # mkdir trusted_roots; cp authorities/planetlab.gid trusted_roots/ @@ -34,7 +34,7 @@ from util.hierarchy import Hierarchy from util.trustedroot import TrustedRootList from util.cert import Keypair, Certificate from registry import Registry -from aggregate import Aggregate +#from aggregate import Aggregate from slicemgr import SliceMgr def main(): @@ -78,6 +78,7 @@ def main(): if (options.registry): r = Registry("", registry_port, key_file, cert_file) r.trusted_cert_list = TrustedRoots.get_list() + r.hierarchy = AuthHierarchy r.start() # start aggregate manager diff --git a/plc/registry.py b/plc/registry.py index 16382074..15816c77 100644 --- a/plc/registry.py +++ b/plc/registry.py @@ -6,17 +6,21 @@ import os import time import sys +from util.credential import Credential from util.hierarchy import Hierarchy from util.trustedroot import TrustedRootList from util.cert import Keypair, Certificate from util.gid import GID from util.geniserver import GeniServer from util.record import GeniRecord +from util.rights import RightList from util.genitable import GeniTable from util.geniticket import Ticket from util.excep import * from util.misc import * +from util.config import * + ## # Convert geni fields to PLC fields for use when registering up updating # registry record in the PLC database @@ -132,7 +136,7 @@ class Registry(GeniServer): # @param auth_hrn human readable name of authority def get_auth_info(self, auth_hrn): - return AuthHierarchy.get_auth_info(auth_hrn) + return self.hierarchy.get_auth_info(auth_hrn) ## # Given an authority name, return the database table for that authority. If @@ -347,8 +351,8 @@ class Registry(GeniServer): if (type == "sa") or (type=="ma"): # update the tree - if not AuthHierarchy.auth_exists(name): - AuthHierarchy.create_auth(name) + if not self.hierarchy.auth_exists(name): + self.hierarchy.create_auth(name) # authorities are special since they are managed by the registry # rather than by the caller. We create our own GID for the @@ -729,7 +733,7 @@ class Registry(GeniServer): rl = self.determine_rights(type, name) cred.set_privileges(rl) - cred.set_parent(AuthHierarchy.get_auth_cred(auth_hrn)) + cred.set_parent(self.hierarchy.get_auth_cred(auth_hrn)) cred.encode() cred.sign() @@ -775,7 +779,7 @@ class Registry(GeniServer): rl = self.determine_rights(type, name) new_cred.set_privileges(rl) - new_cred.set_parent(AuthHierarchy.get_auth_cred(auth_hrn)) + new_cred.set_parent(self.hierarchy.get_auth_cred(auth_hrn)) new_cred.encode() new_cred.sign() @@ -808,7 +812,7 @@ class Registry(GeniServer): pkey = Keypair() pkey.load_pubkey_from_string(pubkey_str) - gid = AuthHierarchy.create_gid(name, uuid, pkey) + gid = self.hierarchy.create_gid(name, uuid, pkey) return gid.save_to_string(save_parents=True) diff --git a/plc/slicemgr.py b/plc/slicemgr.py index 74cf69a4..a61909a2 100644 --- a/plc/slicemgr.py +++ b/plc/slicemgr.py @@ -17,6 +17,8 @@ from util.geniticket import Ticket from util.excep import * from util.misc import * +from util.config import * + ## # SliceMgr class extends GeniServer class -- 2.43.0