fewer import * for certificate
[sfa.git] / geni / methods / create_gid.py
index 7e8b6fd..e4560b4 100644 (file)
@@ -1,9 +1,12 @@
+### $Id$
+### $URL$
+
+from geni.trust.certificate import Keypair 
+
 from geni.util.faults import *
-from geni.util.excep import *
 from geni.util.method import Method
 from geni.util.parameter import Parameter, Mixed
 from geni.util.auth import Auth
-from geni.util.cert import Keypair 
 
 class create_gid(Method):
     """
@@ -32,7 +35,7 @@ class create_gid(Method):
     returns = Parameter(str, "String represeneation of a GID object")
     
     def call(self, cred, hrn, uuid, pubkey_str):
-        self.api.auth.decode_authentication(cred, "getcredential")
+        self.api.auth.check(cred, "getcredential")
         self.api.auth.verify_object_belongs_to_me(hrn)
         self.api.auth.verify_object_permission(hrn)
 
@@ -41,6 +44,6 @@ class create_gid(Method):
 
         pkey = Keypair()
         pkey.load_pubkey_from_string(pubkey_str)
-        gid = self.api.auth.hierarchy.create_gid(name, uuid, pkey)
+        gid = self.api.auth.hierarchy.create_gid(hrn, uuid, pkey)
 
         return gid.save_to_string(save_parents=True)