xml issue with Type 'bool' cannot be serialized

Noah noah-list at enabled.com
Thu Aug 28 16:58:48 EDT 2014


Hi list,

I am not clear how to fix this issue.

Traceback (most recent call last):
   File "./command.py", line 81, in <module>
     connect(host, USER, PASSWORD)
   File "./command.py", line 63, in connect
     dump = etree.tostring(xml_cmd)
   File "lxml.etree.pyx", line 3165, in lxml.etree.tostring 
(src/lxml/lxml.etree.c:69414)
TypeError: Type 'bool' cannot be serialized.


here is snippets from the code



--- code ---

from jnpr.junos import Device
from jnpr.junos.utils.config import Config
from lxml import etree
import jnpr.junos.exception
import sys, os, time, re, getopt

def connect(host, user, password):
     conn = Device(host=host, user=user, password=password).open()

     xml_cmd = ''
     xml_cmd = conn.rpc.get_configuration()
     dump = etree.tostring(xml_cmd)
     print dump




More information about the Python-list mailing list