summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2009-03-06 11:11:41 -0500
committerMichael DeHaan <mdehaan@redhat.com>2009-03-06 11:11:41 -0500
commit6d6b61680485359b1d5e53c34ba5b879a39e4ba5 (patch)
treec807c8cf8959a7be766ace8b038720236ff70db9
parent7653a96c3997d0beb92267a103c071c311ca899a (diff)
downloadcobbler-6d6b61680485359b1d5e53c34ba5b879a39e4ba5.tar.gz
cobbler-6d6b61680485359b1d5e53c34ba5b879a39e4ba5.tar.xz
cobbler-6d6b61680485359b1d5e53c34ba5b879a39e4ba5.zip
XMLRPC hack, add missing snippet
-rw-r--r--cobbler/remote.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/cobbler/remote.py b/cobbler/remote.py
index d1935712..3e7230c6 100644
--- a/cobbler/remote.py
+++ b/cobbler/remote.py
@@ -50,6 +50,18 @@ import item_image
from utils import *
from utils import _
+# Replace the dumps() function in xmlrpclib with one that by default
+# handles None, so SimpleXMLRPCServer can return None.
+# in a way that's compatible with ancient Pythons that can't
+# simply do allow_none=True
+class _xmldumps(object):
+ def __init__(self, dumps):
+ self.__dumps = (dumps,)
+ def __call__(self, *args, **kwargs):
+ kwargs.setdefault('allow_none', 1)
+ return self.__dumps[0](*args, **kwargs)
+xmlrpclib.dumps = _xmldumps(xmlrpclib.dumps)
+
# FIXME: make configurable?
TOKEN_TIMEOUT = 60*60 # 60 minutes
OBJECT_TIMEOUT = 60*60 # 60 minutes
@@ -1570,7 +1582,7 @@ class CobblerXMLRPCInterface:
class CobblerXMLRPCServer(SimpleXMLRPCServer.SimpleXMLRPCServer):
def __init__(self, args):
self.allow_reuse_address = True
- SimpleXMLRPCServer.SimpleXMLRPCServer.__init__(self,args,allow_none=True)
+ SimpleXMLRPCServer.SimpleXMLRPCServer.__init__(self,args)
# *********************************************************************************
# *********************************************************************************