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

Christy Perez christy at linux.vnet.ibm.com
Tue Nov 18 16:40:23 UTC 2014


Reviewed-By: Christy Perez <christy at linux.vnet.ibm.com>

On 11/18/2014 03:07 AM, lvroyce at linux.vnet.ibm.com wrote:
> 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 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/kimchi/model/utils.py b/src/kimchi/model/utils.py
> index dc911a9..9896289 100644
> --- a/src/kimchi/model/utils.py
> +++ b/src/kimchi/model/utils.py
> @@ -142,7 +142,8 @@ def _kimchi_get_metadata_node(dom, tag):
>              if i >= 0:
>                  elem.tag = elem.tag[i+1:]
> 
> -        objectify.deannotate(kimchi, cleanup_namespaces=True)
> +        objectify.deannotate(kimchi)
> +        etree.cleanup_namespaces(kimchi)
>          return kimchi
>      return None
> 




More information about the Kimchi-devel mailing list