From mboxrd@z Thu Jan 1 00:00:00 1970 From: kupcevic@sourceware.org Date: 28 Jun 2006 20:20:21 -0000 Subject: [Cluster-devel] conga/ricci/test Variable.py add_sources_rende ... Message-ID: <20060628202021.28477.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Changes by: kupcevic at sourceware.org 2006-06-28 20:20:20 Modified files: ricci/test : Variable.py add_sources_renderer.py Log message: storage cgi test: fix add_sources Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test/Variable.py.diff?cvsroot=cluster&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test/add_sources_renderer.py.diff?cvsroot=cluster&r1=1.2&r2=1.3 --- conga/ricci/test/Variable.py 2006/04/07 16:42:40 1.2 +++ conga/ricci/test/Variable.py 2006/06/28 20:20:20 1.3 @@ -261,13 +261,13 @@ elem.setAttribute('name', self.__name) elem.setAttribute('type', self.type()) - l = self.get_value() - for i in range(len(l)): - x = l[i] - e2 = doc.createElement(VARIABLE_TYPE_LISTENTRY) - e2.setAttribute('value', str(x)) - e2.setAttribute('list_index', str(i)) - elem.appendChild(e2) + for x in self.get_value(): + if self.type() == VARIABLE_TYPE_LIST_XML: + elem.appendChild(x) + else: + e2 = doc.createElement(VARIABLE_TYPE_LISTENTRY) + e2.setAttribute('value', str(x)) + elem.appendChild(e2) for mod in self.__mods: elem.setAttribute(str(mod), str(self.__mods[mod])) return elem --- conga/ricci/test/add_sources_renderer.py 2006/04/07 16:42:40 1.2 +++ conga/ricci/test/add_sources_renderer.py 2006/06/28 20:20:20 1.3 @@ -125,10 +125,7 @@ func.appendChild(Variable('mapper_type', mapper_type).export_xml(doc)) func.appendChild(Variable('mapper_id', mapper_id).export_xml(doc)) func.appendChild(Variable('mapper_state_ind', mapper_state_ind).export_xml(doc)) - node_l = doc.createElement("list") - for s in sources: - node_l.appendChild(s) - func.appendChild(Variable("bds", node_l).export_xml(doc)) + func.appendChild(VariableList("bds", sources, {}, VARIABLE_TYPE_LIST_XML).export_xml(doc)) req.appendChild(func) ### submit request ###