[Kimchi-devel] [PATCH] Use dedicate function to remove unused namespace

lvroyce at linux.vnet.ibm.com lvroyce at linux.vnet.ibm.com
Tue Nov 18 07:26:13 UTC 2014


From: Royce Lv <lvroyce at linux.vnet.ibm.com>

c5cb1515 used "cleanup_namespaces=True" to clean unused namespace.
But on rhel lxml library, this argument is not supported and result
in error:
File "./src/kimchi/model/utils.py", line 145,
        in _kimchi_get_metadata_node
    objectify.deannotate(kimchi, cleanup_namespaces=True)
  File "lxml.objectify.pyx", line 1728,
      in lxml.objectify.deannotate (src/lxml/lxml.objectify.c:17914)
TypeError: deannotate() got an unexpected keyword argument 'cleanup_namespaces'

So use a dedicate function to clean the unused namespace.

Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
---
 src/kimchi/model/utils.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/kimchi/model/utils.py b/src/kimchi/model/utils.py
index dc911a9..e02ec66 100644
--- a/src/kimchi/model/utils.py
+++ b/src/kimchi/model/utils.py
@@ -143,6 +143,7 @@ def _kimchi_get_metadata_node(dom, tag):
                 elem.tag = elem.tag[i+1:]
 
         objectify.deannotate(kimchi, cleanup_namespaces=True)
+        etree.cleanup_namespaces(kimchi)
         return kimchi
     return None
 
-- 
1.8.3.2




More information about the Kimchi-devel mailing list