ciscoconfparse

How to fix “AttributeError: 'module' object has no attribute 'SOL_UDP'” error in Python Connector Mule

流过昼夜 提交于 2021-02-19 08:45:44
问题 I'm trying to execute a basic script to return Cisco Config File as a JSON Format, and I have a success process over Python2.7.16 and Python 3.7.3, but when I'm trying to execute the same script over Python Connector for Mule ESB I receive the error refered in the title of this thread. This is for a Mule feature, the Python connector script in this tool, works with a Jython 2.7.1, and is loaded as a library for the Mule. I expect the output as a JSON file but actual output is: Root Exception

Python ciscoconfparse to find all interfaces block which has not been “shutdown” explicitly and it's whole interface block as well?

混江龙づ霸主 提交于 2021-01-29 15:09:48
问题 I've been reading about https://pypi.org/project/ciscoconfparse/ and found that it can do this. Which interfaces are missing a critical command? Here is my scenario. First of all, I will try to find interface block that has shutdown in it. Second script is the other way around which is to find interface block that doesn't has shutdown in it. Sample of Cisco config file. $ cat exampleswitch.conf ! filename:exampleswitch.conf ! hostname ExampleSwitch ! no ip domain lookup ! interface

Python ciscoconfparse to find shutdown interfaces and the whole interface block?

折月煮酒 提交于 2021-01-24 10:43:18
问题 The following examples will use this configuration which is taken from http://pennington.net/tutorial/ciscoconfparse/ccp_tutorial.html#slide3 ! filename:exampleswitch.conf ! hostname ExampleSwitch ! interface GigabitEthernet 1/1 switchport mode trunk shutdown ! interface GigabitEthernet 1/2 switchport mode access switchport access vlan 20 switchport nonegotiate no cdp enable ! interface GigabitEthernet 1/3 no switchport ip address 192.0.2.1 255.255.255.0 This is the code which is also taken

Python ciscoconfparse to find shutdown interfaces and the whole interface block?

强颜欢笑 提交于 2021-01-24 10:39:20
问题 The following examples will use this configuration which is taken from http://pennington.net/tutorial/ciscoconfparse/ccp_tutorial.html#slide3 ! filename:exampleswitch.conf ! hostname ExampleSwitch ! interface GigabitEthernet 1/1 switchport mode trunk shutdown ! interface GigabitEthernet 1/2 switchport mode access switchport access vlan 20 switchport nonegotiate no cdp enable ! interface GigabitEthernet 1/3 no switchport ip address 192.0.2.1 255.255.255.0 This is the code which is also taken

ciscoconfparse in Python 3.4 module doesn't import correctly

北城余情 提交于 2019-12-13 00:49:24
问题 I'm trying to install a python module called ciscoconfparse on Linux Mint 17. When I install it with pip with python 2, all works well when I try to import, but when I try it with pip3 (for Python 3.4), the module shows up in the install directory, but I can't import any parts of it. I can find the module here /usr/local/lib/python3.4/dist-packages/ciscoconfparse-1.1.1-py3.4.egg/ciscoconfparse Inside this directory is the ciscoconfparse.py file, which has the CiscoConfParse class, but I can't