call logging
[sfa.git] / sfa / methods / remove.py
index e66fb30..dab6bf3 100644 (file)
@@ -8,6 +8,7 @@ from sfa.trust.auth import Auth
 from sfa.util.record import GeniRecord
 from sfa.util.genitable import GeniTable
 from sfa.util.debug import log
+from sfa.trust.credential import Credential
 
 class remove(Method):
     """
@@ -31,8 +32,13 @@ class remove(Method):
 
     returns = Parameter(int, "1 if successful")
     
-    def call(self, cred, type, hrn):
+    def call(self, cred, type, hrn, caller_cred=None):
         self.api.auth.check(cred, "remove")
+       if caller_cred==None:
+          caller_cred=cred
+       
+       #log the call
+       self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, Credential(string=caller_cred).get_gid_caller().get_hrn(), hrn, self.name))
         self.api.auth.verify_object_permission(hrn)
         table = GeniTable()
         filter = {'hrn': hrn}