~anso/nova/trunk_safe

« back to all changes in this revision

Viewing changes to nova/api/openstack/wsgi.py

merged security group fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
        doc = minidom.Document()
233
233
        node = self._to_xml_node(doc, self.metadata, root_key, data[root_key])
234
234
 
235
 
        xmlns = node.getAttribute('xmlns')
236
 
        if not xmlns and self.xmlns:
 
235
        self._add_xmlns(node)
 
236
 
 
237
        return node.toprettyxml(indent='    ', encoding='utf-8')
 
238
 
 
239
    def _add_xmlns(self, node):
 
240
        if self.xmlns is not None:
237
241
            node.setAttribute('xmlns', self.xmlns)
238
242
 
239
 
        return node.toprettyxml(indent='    ', encoding='utf-8')
240
 
 
241
243
    def _to_xml_node(self, doc, metadata, nodename, data):
242
244
        """Recursive method to convert data members to XML nodes."""
243
245
        result = doc.createElement(nodename)