- forgot nm.py
[nodemanager.git] / plcapi.py
index fd04b6a..e89663d 100644 (file)
--- a/plcapi.py
+++ b/plcapi.py
@@ -1,9 +1,9 @@
-import xmlrpclib
+import safexmlrpc
 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:
 
@@ -23,7 +23,7 @@ class PLCAPI:
             self.node_id = self.key = None
             self.session = auth
 
-        self.server = xmlrpclib.ServerProxy(uri, allow_none = 1, **kwds)
+        self.server = safexmlrpc.ServerProxy(uri, allow_none = 1, **kwds)
 
     def add_auth(self, function):
         """
@@ -44,12 +44,12 @@ class PLCAPI:
                 if isinstance(arg, list) or isinstance(arg, tuple):
                     # The old implementation did not recursively handle
                     # lists of lists. But neither did the old API itself.
-                    values += self.canonicalize(arg)
+                    values += canonicalize(arg)
                 elif isinstance(arg, dict):
                     # Yes, the comments in the old implementation are
                     # misleading. Keys of dicts are not included in the
                     # hash.
-                    values += self.canonicalize(arg.values())
+                    values += canonicalize(arg.values())
                 else:
                     # We use unicode() instead of str().
                     values.append(unicode(arg))