fix missing module imports
authorScott Baker <bakers@cs.arizona.edu>
Tue, 6 Jan 2009 06:20:13 +0000 (06:20 +0000)
committerScott Baker <bakers@cs.arizona.edu>
Tue, 6 Jan 2009 06:20:13 +0000 (06:20 +0000)
plc/plc.py
plc/registry.py
plc/slicemgr.py

index 1c7f38d..013ef53 100644 (file)
@@ -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
 #    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/
 #    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 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():
 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()
     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
         r.start()
 
     # start aggregate manager
index 1638207..15816c7 100644 (file)
@@ -6,17 +6,21 @@ import os
 import time
 import sys
 
 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.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.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
 ##
 # 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):
     # @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
 
     ##
     # 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 (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
 
             # 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)
 
         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()
 
         cred.encode()
         cred.sign()
@@ -775,7 +779,7 @@ class Registry(GeniServer):
         rl = self.determine_rights(type, name)
         new_cred.set_privileges(rl)
 
         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()
 
         new_cred.encode()
         new_cred.sign()
@@ -808,7 +812,7 @@ class Registry(GeniServer):
 
         pkey = Keypair()
         pkey.load_pubkey_from_string(pubkey_str)
 
         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)
 
 
         return gid.save_to_string(save_parents=True)
 
index 74cf69a..a61909a 100644 (file)
@@ -17,6 +17,8 @@ from util.geniticket import Ticket
 from util.excep import *
 from util.misc import *
 
 from util.excep import *
 from util.misc import *
 
+from util.config import *
+
 ##
 # SliceMgr class extends GeniServer class
 
 ##
 # SliceMgr class extends GeniServer class