From 113b3757b0753a31ba86028a55a2c34dfa3f786c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Fri, 25 Feb 2011 16:35:20 +0000
Subject: [PATCH]  - allow to pass empty parameters and do not die in such
 momemnt,    fallback to reasonable defaults

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43779 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/Vifib/Tool/SlapTool.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/product/Vifib/Tool/SlapTool.py b/product/Vifib/Tool/SlapTool.py
index fdb5fe189da..03556c4a739 100644
--- a/product/Vifib/Tool/SlapTool.py
+++ b/product/Vifib/Tool/SlapTool.py
@@ -556,10 +556,20 @@ class SlapTool(BaseTool):
 
     In any other case returns not important data and HTTP code is 403 Forbidden
     """
-    shared = xml_marshaller.xml_marshaller.loads(shared_xml)
-    partition_parameter_kw = xml_marshaller.xml_marshaller.loads(
+    if shared_xml:
+      shared = xml_marshaller.xml_marshaller.loads(shared_xml)
+    else:
+      shared = False
+    if partition_parameter_xml:
+      partition_parameter_kw = xml_marshaller.xml_marshaller.loads(
                                               partition_parameter_xml)
-    filter_kw = xml_marshaller.xml_marshaller.loads(filter_xml)
+    else:
+      partition_parameter_kw = dict()
+    if filter_xml:
+      filter_kw = xml_marshaller.xml_marshaller.loads(filter_xml)
+    else:
+      filter_kw = dict()
+      
     instance = etree.Element('instance')
     for parameter_id, parameter_value in partition_parameter_kw.iteritems():
       # cast everything to string
-- 
2.30.9