X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plcapi.py;h=759207e591dda83d6e7606b6714d7e120e07677a;hb=562fa2da503a7c4786fbf04e14c8b304ff62ba81;hp=e89663d5644960534fa015b0e555edb28f31f3c2;hpb=b0deb4f91ea673181a2db5ee432f8d9c36fc7312;p=nodemanager.git diff --git a/plcapi.py b/plcapi.py index e89663d..759207e 100644 --- a/plcapi.py +++ b/plcapi.py @@ -1,3 +1,5 @@ +# $Id$ + import safexmlrpc import hmac, sha @@ -15,7 +17,7 @@ class PLCAPI: the new session-based method. """ - def __init__(self, uri, auth, **kwds): + def __init__(self, uri, cacert, auth, timeout = 90, **kwds): if isinstance(auth, (tuple, list)): (self.node_id, self.key) = auth self.session = None @@ -23,7 +25,7 @@ class PLCAPI: self.node_id = self.key = None self.session = auth - self.server = safexmlrpc.ServerProxy(uri, allow_none = 1, **kwds) + self.server = safexmlrpc.ServerProxy(uri, cacert, timeout, allow_none = 1, **kwds) def add_auth(self, function): """ @@ -64,7 +66,8 @@ class PLCAPI: if self.session is not None: # Use session authentication - auth = {'session': self.session} + auth = {'AuthMethod': "session", + 'session': self.session} else: # Yes, this is the "canonicalization" method used. args = canonicalize(params)