again getting away with caller_cred and passing just the hrn of the initial caller
[sfa.git] / sfa / methods / remove_peer_object.py
index b9b337f..81a9e53 100644 (file)
@@ -26,17 +26,18 @@ class remove_peer_object(Method):
     
     accepts = [
         Parameter(str, "Credential string"),
-        Parameter(dict, "Record dictionary")
-        Parameter(str, "Request hash"),
+        Parameter(dict, "Record dictionary"),
+        Mixed(Parameter(str, "Request hash"),
+              Parameter(None, "Request hash not specified"))
         ]
 
     returns = Parameter(int, "1 if successful")
     
-    def call(self, cred, record, request_hash, caller_cred=None):
-        if caller_cred==None:
-            caller_cred=cred
+    def call(self, cred, record, request_hash=None, origin_hrn=None):
+        if origin_hrn==None:
+            origin_hrn=Credential(string=cred).get_gid_caller().get_hrn()
         #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(), record['hrn'], self.name))
+        self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, record['hrn'], self.name))
         self.api.auth.authenticateCred(cred, [cred], request_hash) 
         self.api.auth.check(cred, "remove")