Automation

 View Only
last person joined: 6 days ago 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.
  • 1.  'Console' object has no attribute '_use_filter' Junos-eznc

    Posted 03-23-2020 17:09

    when i run a simple code like that :

    from jnpr.junos import Device
    from jnpr.junos.op.routes import RouteTable

    dev = Device(host='xxxx', user='demo', password='demo123', gather_facts=False)
    dev.open()

    tbl = RouteTable(dev)
    tbl.get()
    #tbl.get('10.13.10.0/23', protocol='static')
    print tbl
    for item in tbl:
    print 'protocol:', item.protocol
    print 'age:', item.age
    print 'via:', item.via
    print

    dev.close()

     

    it keeps getting this error : (AttributeError: 'Console' object has no attribute '_use_filter') in this file (\jnpr\junos\factory\table.py) as i didnt change anything inside the library.

     

    it also didnt read the yaml file while importing (from jnpr.junos.op.routes import RouteTable)

     

    Junos-eznc version :2.3.1

    Jinja2 version :3.0.0a1

     



  • 2.  RE: 'Console' object has no attribute '_use_filter' Junos-eznc

     
    Posted 03-23-2020 19:00

    Hi myehiaa,

     

    The script works fine, I've checked on:

     

    Python 2.7.14

    PyYAML 5.1.1

    Jinja2 2.10.1
    junos-eznc 2.2.1

     

    Try deleting some of this packages using "pip uninstall <pkg_name>" and re-install if that resolves.  If the YAML wasn't read, it's to do with versioning or you're missing one of the packages above.  Please keep us posted with your resolution.

     

    Hope this helps.

    Regards,
    -r.

    --------------------------------------------------

    If this solves your problem, please mark this post as "Accepted Solution."
    Kudos are always appreciated :).



  • 3.  RE: 'Console' object has no attribute '_use_filter' Junos-eznc

    Posted 03-24-2020 06:06

    Hi Mriyaz,

     

    After installing your versions :-

    PyYAML 5.1.1

    Jinja2 2.10.1
    junos-eznc 2.2.1

    the script starts to work ,

    but is there a global problem with these versions ?

    Junos-eznc version :2.3.1

    Jinja2 version :3.0.0a1

    Python:3.8

    PYyaml: 5.3.1

     



  • 4.  RE: 'Console' object has no attribute '_use_filter' Junos-eznc
    Best Answer

     
    Posted 03-24-2020 19:13

    Hello myehiaa,

     

    There's an issue with installation of PyEZ dependencies with 3.8, perhaps because it's too new.  You can use Python 3.4 for now, thats working too.

     

    Hope this helps.

    Regards,
    -r.

    --------------------------------------------------

    If this solves your problem, please mark this post as "Accepted Solution."
    Kudos are always appreciated :).