Automation

last person joined: 3 days ago 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.
  • 1.  pyez problem with connection to device

    Posted 05-05-2016 05:46

    Hi folks!

     

    I installed ez-library and as is prescribed here https://forums.juniper.net/t5/Automation-Programmability/Python-for-Non-Programmers-Part-2/ba-p/216983 try to establish connection to ex3300 switch, but error occures:

    >>> from jnpr.junos import Device
    >>> dev = Device(host='10.10.0.10', user='test', password='test')
    >>> dev.open()
    No handlers could be found for logger "ncclient.transport.ssh"
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python2.7/dist-packages/jnpr/junos/device.py", line 483, in open
    raise cnx_err
    jnpr.junos.exception.ConnectError: ConnectError(host: 10.127.97.10, msg: 'EntryPoint' object has no attribute 'resolve')

     

    I have found somewhere, that "No handlers could be found for logger "ncclient.transport.ssh"" is because PyEZ tries to connect to NETCONF over the RFC-defined port 830, so i added port parameter, this line about handlers disappeared, but all the rest is here:

    >>> dev=Device('10.127.97.10',user='user',password='passwd',port=22)
    >>> dev.open()
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python2.7/dist-packages/jnpr/junos/device.py", line 483, in open
    raise cnx_err
    jnpr.junos.exception.ConnectError: ConnectError(host: 10.127.97.10, msg: 'EntryPoint' object has no attribute 'resolve')

     

    Any thoughts where the cause is?

    Thank you in advance!

     



  • 2.  RE: pyez problem with connection to device

     
    Posted 05-05-2016 08:50

    Hi,

     

    This sounds like netconf hasn't been configured on the device, although, it might also be worthwhile checking to see which version of ncclient is installed too (pip  show ncclient), and upgrade it to 0.4.7 which is the latest stable release for Python2 as of Jan 2016).  e.g.  "pip install -U ncclient" or "pip install ncclient==0.4.7) etc.

     

    system {
        services {
            netconf {
                ssh;
            }
        }
    }

    Regards,

    Andy

     



  • 3.  RE: pyez problem with connection to device

    Posted 05-06-2016 01:44

    Hi Andy,

     

    checked both things: netconf on device is configured as like you showed, and version of ncclient on server is exactly 0.4.7



  • 4.  RE: pyez problem with connection to device

     
    Posted 05-09-2016 03:15

    Umm..... not a message that I've seen before, and took a look through my archives and still none the wiser.

     

    Could you check the following versions and see if you get any differences...?

     

    junos-eznc : 1.3.1
    lxml : 3.6.0
    ncclient : 0.4.7
    setuptools : 20.4
    paramiko : 1.16.0
    scp : 0.10.2
    jinja2 : 2.8
    PyYAML: 3.11
    netaddr : 0.7.18
    


  • 5.  RE: pyez problem with connection to device

    Posted 08-18-2016 11:03

    Hello everyone.

     

    I have the same message here in my test. I'm try to work with MacOSX 10.11

     

    HunterNET:PyEz JN$ python teste.py 
    No handlers could be found for logger "ncclient.transport.ssh"
    Traceback (most recent call last):
      File "teste.py", line 5, in <module>
        dev.open()
      File "/Library/Python/2.7/site-packages/jnpr/junos/device.py", line 787, in open
        raise cnx_err
    jnpr.junos.exception.ConnectError: ConnectError(host: 10.151.10.228, msg: 'EntryPoint' object has no attribute 'resolve')
    

     

    Any help will be great.

     

    Regards

     

    //JN



  • 6.  RE: pyez problem with connection to device

     
    Posted 08-18-2016 11:09

    Could you check the following versions and see if you get any differences...?

     

    junos-eznc : 1.3.1
    lxml : 3.6.0
    ncclient : 0.4.7
    setuptools : 20.4
    paramiko : 1.16.0
    scp : 0.10.2
    jinja2 : 2.8
    PyYAML: 3.11
    netaddr : 0.7.18
    

     

    Regards,

    Andy



  • 7.  RE: pyez problem with connection to device

    Posted 08-18-2016 13:13

    Hello Asharp,

     

    I did a downgrade from my Cryptography package from Python and they works fine.

     

     

    sudo pip install cryptography==1.2.1

    I found this issue in: 

     

    Cannot get dev.open() to work

     

     

    Thanks for your help.

     

    //JNetto



  • 8.  RE: pyez problem with connection to device

    Posted 09-07-2016 07:04

    I'm having this same issue too.

     

    [root@centos6 junos_python_scripts]# python2.7 dev_facts.py
    No handlers could be found for logger "ncclient.transport.ssh"
    Traceback (most recent call last):
    File "dev_facts.py", line 7, in <module>
    dev.open()
    File "/usr/local/lib/python2.7/site-packages/jnpr/junos/device.py", line 787, in open
    raise cnx_err
    jnpr.junos.exception.ConnectError: ConnectError(host: 10.0.0.1, msg: 'EntryPoint' object has no attribute 'resolve')

     

    And I did this to fix it:

    pip install --upgrade distribute

     

    Here is the new output

     

    [root@centos6 junos_python_scripts]# python2.7 dev_facts.py
    {'2RE': False,
    'HOME': '/cf/root',
    'RE0': {'last_reboot_reason': '0x1:power cycle/failure',
    'model': 'RE-SRX210H',
    'status': 'OK',
    'up_time': '180 days, 21 hours, 11 minutes, 11 seconds'},
    'domain': None,
    'fqdn': 'homefwsrx210',
    'hostname': 'homefwsrx210',
    'ifd_style': 'CLASSIC',
    'model': 'SRX210H',
    'personality': 'SRX_BRANCH',
    'serialnumber': 'XXX',
    'srx_cluster': False,
    'switch_style': 'VLAN',
    'vc_capable': False,
    'version': '12.1X46-D40.2',
    'version_info': junos.version_info(major=(12, 1), type=X, minor=(46, 'D', 40), build=2)}
    [root@centos6 junos_python_scripts]#