Closed jorgenbl closed 7 years ago
I have been a bit out of the loop on the del method work. I think @mirceaulinic is working on this.
It shouldn't hurt anything so in the interim until we fix this, you can gracefully handle it using a try/except statement.
OK, thanks for the quick response.
@jorgenbl are you getting that error using the latest napalm-base
? Could you try to upgrade with pip install -U napalm-base
and let us know if it still happens?
root@90e9d99176d9:/# pip install -U napalm-base Requirement already up-to-date: napalm-base in /usr/local/lib/python2.7/dist-packages Requirement already up-to-date: pyYAML in /usr/local/lib/python2.7/dist-packages (from napalm-base) Requirement already up-to-date: jinja2 in /usr/local/lib/python2.7/dist-packages (from napalm-base) Requirement already up-to-date: jtextfsm in /usr/local/lib/python2.7/dist-packages (from napalm-base) Requirement already up-to-date: netaddr in /usr/local/lib/python2.7/dist-packages (from napalm-base) Requirement already up-to-date: MarkupSafe>=0.23 in /usr/local/lib/python2.7/dist-packages (from jinja2->napalm-base) root@90e9d99176d9:/# python testNapalm.py {u'os_version': u'7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.1(4)M, RELEASE SOFTWARE (fc1)', u'uptime': 7800, u'interface_list': [u'FastEthernet0/0', u'FastEthernet1/0', u'FastEthernet1/1', u'FastEthernet2/0', u'FastEthernet2/1', u'GigabitEthernet3/0', u'GigabitEthernet4/0', u'GigabitEthernet5/0', u'GigabitEthernet6/0', u'Loopback0'], u'vendor': u'Cisco', u'serial_number': u'4279256517', u'model': u'7206VXR', u'hostname': u'router', u'fqdn': u'router.test.net'} {u'is_alive': True} {u'is_alive': False} Exception socket.error: error('Socket is closed',) in <bound method IOSDriver.del of <napalm_ios.ios.IOSDriver object at 0x7f63ef977190>> ignored
Ok, I will take a look during that weekend. Thanks for reporting.
I proposed a fix for this here: https://github.com/napalm-automation/napalm-base/pull/235
Description of Issue/Question
I get a "Socket error" each time I connect to a cisco device. The get_facts() function seem to work as it should. It seems to be related to handling the connection. See below for example. (tested with Python2.7) Problem similar when testing on Python3.6.
Did you follow the steps from https://github.com/napalm-automation/napalm#faq
Setup
napalm-ios version
(Paste verbatim output from
pip freeze | grep napalm-ios
between quotes below)IOS version
(Paste verbatim output from
show version
between quotes below)Steps to Reproduce the Issue
Error Traceback
(Paste the complete traceback of the exception between quotes below)