summaryrefslogtreecommitdiffstats
path: root/cobbler
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2009-03-06 11:27:15 -0500
committerMichael DeHaan <mdehaan@redhat.com>2009-03-06 11:27:15 -0500
commit42bcd7f588f448f002a929caa3f4ede8a4d135da (patch)
tree33b7e74d7293b2322a2a72de0e61529778e7a11d /cobbler
parent6d6b61680485359b1d5e53c34ba5b879a39e4ba5 (diff)
downloadcobbler-42bcd7f588f448f002a929caa3f4ede8a4d135da.tar.gz
cobbler-42bcd7f588f448f002a929caa3f4ede8a4d135da.tar.xz
cobbler-42bcd7f588f448f002a929caa3f4ede8a4d135da.zip
Package a snippet, and some paranoid checks to make sure XMLRPC doesn't send a none.
Diffstat (limited to 'cobbler')
-rw-r--r--cobbler/remote.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/cobbler/remote.py b/cobbler/remote.py
index 3e7230c6..ac775c53 100644
--- a/cobbler/remote.py
+++ b/cobbler/remote.py
@@ -50,18 +50,6 @@ 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
@@ -916,9 +904,13 @@ class CobblerXMLRPCInterface:
elif type(data) == dict:
data2 = {}
for key in data.keys():
+ keydata = data[key]
data2[str(key)] = self.xmlrpc_hacks(data[key])
return data2
+ else:
+ data = '~'
+
return data
def get_status(self,**rest):