git://git.onelab.eu
/
nodemanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Expand the glob.
[nodemanager.git]
/
plcapi.py
diff --git
a/plcapi.py
b/plcapi.py
index
11d37db
..
759207e
100644
(file)
--- a/
plcapi.py
+++ b/
plcapi.py
@@
-1,9
+1,11
@@
-import xmlrpclib
+# $Id$
+
+import safexmlrpc
import hmac, sha
class PLCAPI:
"""
import hmac, sha
class PLCAPI:
"""
- Wrapper around
xmlrpclib
.ServerProxy to automagically add an Auth
+ Wrapper around
safexmlrpc
.ServerProxy to automagically add an Auth
struct as the first argument to every XML-RPC call. Initialize
auth with either:
struct as the first argument to every XML-RPC call. Initialize
auth with either:
@@
-15,7
+17,7
@@
class PLCAPI:
the new session-based method.
"""
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
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.node_id = self.key = None
self.session = auth
- self.server =
xmlrpclib.ServerProxy(uri
, allow_none = 1, **kwds)
+ self.server =
safexmlrpc.ServerProxy(uri, cacert, timeout
, allow_none = 1, **kwds)
def add_auth(self, function):
"""
def add_auth(self, function):
"""
@@
-64,7
+66,8
@@
class PLCAPI:
if self.session is not None:
# Use session authentication
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)
else:
# Yes, this is the "canonicalization" method used.
args = canonicalize(params)