Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-ciscoconfparse for
openSUSE:Factory checked in at 2023-01-18 17:11:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ciscoconfparse (Old)
and /work/SRC/openSUSE:Factory/.python-ciscoconfparse.new.32243 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ciscoconfparse"
Wed Jan 18 17:11:26 2023 rev:29 rq:1059388 version:1.7.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-ciscoconfparse/python-ciscoconfparse.changes
2023-01-04 17:53:50.858621871 +0100
+++
/work/SRC/openSUSE:Factory/.python-ciscoconfparse.new.32243/python-ciscoconfparse.changes
2023-01-18 17:11:30.783930030 +0100
@@ -1,0 +2,7 @@
+Wed Jan 18 13:54:32 UTC 2023 - Dirk Müller <[email protected]>
+
+- update to 1.7.1:
+ * Improve config parsing code
+ * Make ConfigList() more stable
+
+-------------------------------------------------------------------
Old:
----
ciscoconfparse-1.7.0.tar.gz
New:
----
ciscoconfparse-1.7.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-ciscoconfparse.spec ++++++
--- /var/tmp/diff_new_pack.j2ikbI/_old 2023-01-18 17:11:31.307932991 +0100
+++ /var/tmp/diff_new_pack.j2ikbI/_new 2023-01-18 17:11:31.311933013 +0100
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
Name: python-ciscoconfparse
-Version: 1.7.0
+Version: 1.7.1
Release: 0
Summary: Library for parsing, querying and modifying Cisco IOS-style
configurations
License: GPL-3.0-or-later
++++++ ciscoconfparse-1.7.0.tar.gz -> ciscoconfparse-1.7.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ciscoconfparse-1.7.0/CHANGES.md
new/ciscoconfparse-1.7.1/CHANGES.md
--- old/ciscoconfparse-1.7.0/CHANGES.md 2023-01-02 15:07:57.459834600 +0100
+++ new/ciscoconfparse-1.7.1/CHANGES.md 2023-01-18 11:10:14.460853000 +0100
@@ -6,13 +6,10 @@
## Version: 1.7.1
-- Released: 2023-01-02
+- Released: 2023-01-18
- Summary:
- - Add deprecat dependency
- - Add more Makefile targets
- - Makefile will successfully ping to internet or fail
- - Update Makefile to delete poetry.lock file
- - Correct 'make ping' logic and other tricky Makefile syntax
+ - Improve config parsing code
+ - Make ConfigList() more stable
## Version: 1.7.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ciscoconfparse-1.7.0/Makefile
new/ciscoconfparse-1.7.1/Makefile
--- old/ciscoconfparse-1.7.0/Makefile 2023-01-02 15:56:14.612502800 +0100
+++ new/ciscoconfparse-1.7.1/Makefile 2023-01-18 10:33:09.000000000 +0100
@@ -1,10 +1,14 @@
DOCHOST ?= $(shell bash -c 'read -p "documentation host: " dochost; echo
$$dochost')
-# VERSION detection:
+
+# dynamic ciscoconfparse VERSION detection (via version str in pyproject.toml)
# Ref -> https://stackoverflow.com/a/71592061/667301
export VERSION := $(shell grep version pyproject.toml | tr -s ' ' | tr -d "'"
| tr -d '"' | cut -d' ' -f3)
-# We MUST escape Makefile dollar signs as $$foo
-export PING_OUTPUT := $(shell perl -e '@output = qx/ping -q -W0.5 -c1
4.2.2.2/; $$alloutput = join "", @output; if ( $$alloutput =~ /\s0\sreceived/ )
{ print "failure"; } else { print "success"; }')
+# We must escape Makefile dollar signs as $$foo...
+export PING_STATUS := $(shell perl -e '@output = qx/ping -q -W0.5 -c1
4.2.2.2/; $$alloutput = join "", @output; if ( $$alloutput =~ /\s0\sreceived/ )
{ print "failure"; } else { print "success"; }')
+
+# Only refresh pip dependencies (via 'make dep') once per day...
+export PIP_DEPENDENCY_AGE := $(shell perl -e 'use File::stat; $$fh = open(FH,
"<", ".pip_dependency") or "open_fail"; if ( $$fh != "open_fail" ) { $$age =
time() - stat(FH)->mtime; } else { print "creating .pip_dependency\n"; `touch
.pip_dependency`; $$age = 0; system("make dep"); }; if ( $$age > 3600*24 ) {
print ".pip_dependency aged out\n"; system("make dep"); `rm -rf
.pip_dependency`; `touch .pip_dependency`; }')
export NUMBER_OF_CCP_TESTS := $(shell grep "def " tests/test*py | wc -l)
@@ -151,7 +155,7 @@
pip install -U passlib==1.7.4
pip install -U loguru==0.6.0
pip install -U toml>=0.10.2
- pip install -U deprecat>=2.1.1
+ pip install -U deprecat==2.1.1
.PHONY: dev
dev:
@@ -192,14 +196,14 @@
.PHONY: ping
ping:
@echo "$(COL_GREEN)>> ping to ensure internet connectivity$(COL_END)"
- @if [ "$${PING_OUTPUT}" = 'success' ]; then return 0; else return 1; fi
+ @if [ "$${PING_STATUS}" = 'success' ]; then return 0; else return 1; fi
.PHONY: test
test:
@echo "$(COL_GREEN)>> running unit tests$(COL_END)"
+ @if [ "$${PIP_DEPENDENCY_AGE}" >= 0 ]; then `make dep` && return 0; fi
$(shell touch .pip_dependency)
make timestamp
- make dep
#make ping
make clean
cd tests && ./runtests.sh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ciscoconfparse-1.7.0/PKG-INFO
new/ciscoconfparse-1.7.1/PKG-INFO
--- old/ciscoconfparse-1.7.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
+++ new/ciscoconfparse-1.7.1/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: ciscoconfparse
-Version: 1.7.0
+Version: 1.7.1
Summary: Parse, Audit, Query, Build, and Modify Cisco IOS-style and
JunOS-style configs
License: GPL-3.0-only
Keywords: Parse,audit,query,modify,Cisco IOS,Cisco,NXOS,ASA,Juniper
@@ -30,7 +30,7 @@
Requires-Dist: Sphinx (==4.3.0)
Requires-Dist: black (>=20.8b1)
Requires-Dist: deprecat (>=2.1.1)
-Requires-Dist: dnspython (>=2.1.0,<3.0.0)
+Requires-Dist: dnspython (>=2.2.0,<3.0.0)
Requires-Dist: loguru (==0.6.0)
Requires-Dist: packaging (>21.0)
Requires-Dist: passlib (>=1.7.4,<2.0.0)
@@ -61,7 +61,7 @@
Short answer: ciscoconfparse is a [Python][10] library
that helps you quickly answer questions like these about your
-configurations:
+Cisco configurations:
- What interfaces are shutdown?
- Which interfaces are in trunk mode?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ciscoconfparse-1.7.0/README.md
new/ciscoconfparse-1.7.1/README.md
--- old/ciscoconfparse-1.7.0/README.md 2022-12-17 12:00:56.507440600 +0100
+++ new/ciscoconfparse-1.7.1/README.md 2023-01-18 10:45:33.000000000 +0100
@@ -9,7 +9,7 @@
Short answer: ciscoconfparse is a [Python][10] library
that helps you quickly answer questions like these about your
-configurations:
+Cisco configurations:
- What interfaces are shutdown?
- Which interfaces are in trunk mode?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/ciscoconfparse-1.7.0/ciscoconfparse/ciscoconfparse.py
new/ciscoconfparse-1.7.1/ciscoconfparse/ciscoconfparse.py
--- old/ciscoconfparse-1.7.0/ciscoconfparse/ciscoconfparse.py 2022-12-12
22:59:40.827519700 +0100
+++ new/ciscoconfparse-1.7.1/ciscoconfparse/ciscoconfparse.py 2023-01-18
11:10:14.460853000 +0100
@@ -148,8 +148,8 @@
__status__ = "Production"
__version__ = get_version_number()
- except:
- raise ValueError()
+ except Exception as eee:
+ raise ValueError(str(eee))
finally:
# These are all the 'dunder variables' required...
@@ -231,7 +231,7 @@
# Based off line1
# } elseif { bar baz } {
this_line_indent -= 1
- child_indent += 0
+ child_indent += 0
retval = results.get('line1', None)
return (this_line_indent, child_indent, retval)
@@ -239,7 +239,7 @@
# Based off line1:
# address 1.1.1.1
this_line_indent -= 0
- child_indent += 0
+ child_indent += 0
retval = results.get('line1', '').strip()
# Strip empty braces here
retval = re.sub(r'\s*\{\s*\}\s*', '', retval)
@@ -269,20 +269,20 @@
# Based off line1
# }
this_line_indent -= 1
- child_indent -= 1
+ child_indent -= 1
return (this_line_indent, child_indent, '')
elif braces_open_right:
# Based off line1
# this that foo {
this_line_indent -= 0
- child_indent += 1
+ child_indent += 1
line = results.get('line1', None) or ''
return (this_line_indent, child_indent, line)
elif (line3_str != '') and (line3_str is not None):
this_line_indent += 0
- child_indent += 0
+ child_indent += 0
return (this_line_indent, child_indent, '')
else:
@@ -4168,7 +4168,7 @@
- Accept a list of diff dicts (diff dicts are hereafter known as
a "line_dict")
- - Duplicate line_dict parent lines may exist in the input
+ - Note that duplicate line_dict parent lines may exist in the input
- Organize the lines such that diff parent lines (example: interface
Foo) are not duplicated.
- Return the updated and reorganized line list.
@@ -4386,11 +4386,8 @@
is_valid_syntax = False
for valid_syntax in ALL_VALID_SYNTAX:
- try:
- assert self.syntax == valid_syntax
+ if self.syntax == valid_syntax:
is_valid_syntax = True
- except Exception:
- pass
assert is_valid_syntax is True
# Support input configuration as either a list or a generator instance
@@ -4560,9 +4557,6 @@
try:
return object.__getattribute__(self, arg)
except Exception:
- pass
-
- try:
calling_function = inspect.stack()[1].function
caller = inspect.getframeinfo(inspect.stack()[1][0])
@@ -4573,9 +4567,6 @@
)
logger.warning(message)
return ccp_method
- except Exception as ff:
- logger.error(str(ff))
- sys.exit(1)
# This method is on ConfigList()
def append(self, val):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ciscoconfparse-1.7.0/pyproject.toml
new/ciscoconfparse-1.7.1/pyproject.toml
--- old/ciscoconfparse-1.7.0/pyproject.toml 2023-01-02 16:23:02.461910500
+0100
+++ new/ciscoconfparse-1.7.1/pyproject.toml 2023-01-18 11:10:14.460853000
+0100
@@ -20,7 +20,7 @@
[tool.poetry]
name = "ciscoconfparse"
-version = "1.7.0"
+version = "1.7.1"
description = "Parse, Audit, Query, Build, and Modify Cisco IOS-style and
JunOS-style configs"
license = "GPL-3.0-only"
authors = ["Mike Pennington <[email protected]>"]
@@ -72,7 +72,7 @@
pyroma = ">=4.0"
passlib = "^1.7.4"
-dnspython = "^2.1.0"
+dnspython = "^2.2.0"
loguru = "0.6.0"
toml = ">=0.10.2"
deprecat = ">=2.1.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ciscoconfparse-1.7.0/setup.py
new/ciscoconfparse-1.7.1/setup.py
--- old/ciscoconfparse-1.7.0/setup.py 1970-01-01 01:00:00.000000000 +0100
+++ new/ciscoconfparse-1.7.1/setup.py 1970-01-01 01:00:00.000000000 +0100
@@ -11,7 +11,7 @@
['Sphinx==4.3.0',
'black>=20.8b1',
'deprecat>=2.1.1',
- 'dnspython>=2.1.0,<3.0.0',
+ 'dnspython>=2.2.0,<3.0.0',
'loguru==0.6.0',
'packaging>21.0',
'passlib>=1.7.4,<2.0.0',
@@ -28,9 +28,9 @@
setup_kwargs = {
'name': 'ciscoconfparse',
- 'version': '1.7.0',
+ 'version': '1.7.1',
'description': 'Parse, Audit, Query, Build, and Modify Cisco IOS-style and
JunOS-style configs',
- 'long_description': 'ciscoconfparse\n==============\n\n[![Github unittest
workflow][4]][5] [![Code Health][37]][38] [![git commits][41]][42] [![Repo Code
Grade][43]][44] [![Version][2]][3] [![Downloads][6]][7]
[![License][8]][9]\n\n\nIntroduction: What is
ciscoconfparse?\n-------------------------------------\n\nShort answer:
ciscoconfparse is a [Python][10] library\nthat helps you quickly answer
questions like these about your\nconfigurations:\n\n- What interfaces are
shutdown?\n- Which interfaces are in trunk mode?\n- What address and subnet
mask is assigned to each interface?\n- Which interfaces are missing a critical
command?\n- Is this configuration missing a standard config line?\n\nIt can
help you:\n\n- Audit existing router / switch / firewall / wlc
configurations\n- Modify existing configurations\n- Build new
configurations\n\nSpeaking generally, the library examines an IOS-style config
and breaks\nit into a set of linked parent / child relationships. You can
perform\n
complex queries about these relationships.\n\n[![Cisco IOS config: Parent /
child][11]][11]\n\nUsage\n-----\n\nThe following code will parse a
configuration stored in\n\\\'exampleswitch.conf\\\' and select interfaces that
are shutdown.\n\n```python\nfrom ciscoconfparse import CiscoConfParse\n\nparse
= CiscoConfParse(\'exampleswitch.conf\', syntax=\'ios\')\n\nfor intf_obj in
parse.find_objects_w_child(\'^interface\', \'^\\s+shutdown\'):\n
print("Shutdown: " + intf_obj.text)\n```\n\nThe next example will find the IP
address assigned to interfaces.\n\n```python\nfrom ciscoconfparse import
CiscoConfParse\n\nparse = CiscoConfParse(\'exampleswitch.conf\',
syntax=\'ios\')\n\nfor intf_obj in parse.find_objects(\'^interface\'):\n\n
intf_name = intf_obj.re_match_typed(\'^interface\\s+(\\S.+?)$\')\n\n #
Search children of all interfaces for a regex match and return\n # the value
matched in regex match group 1. If there is no match,\n # return a default
value: \'\'\n intf_ip_
addr = intf_obj.re_match_iter_typed(\n
r\'ip\\saddress\\s(\\d+\\.\\d+\\.\\d+\\.\\d+)\\s\', result_type=str,\n
group=1, default=\'\')\n print("{0}: {1}".format(intf_name,
intf_ip_addr))\n```\n\nWhat if we don\\\'t use
Cisco?\n----------------------------\n\nDon\\\'t let that stop you.\n\nAs of
CiscoConfParse 1.2.4, you can parse [brace-delimited configurations][13] into a
Cisco IOS style (see [Github Issue \\#17][14]), which means that CiscoConfParse
can parse these configurations:\n\n- Juniper Networks Junos\n- Palo Alto
Networks Firewall configurations\n- F5 Networks
configurations\n\nCiscoConfParse also handles anything that has a Cisco IOS
style of configuration, which includes:\n\n- Cisco IOS, Cisco Nexus, Cisco
IOS-XR, Cisco IOS-XE, Aironet OS, Cisco ASA, Cisco CatOS\n- Arista EOS\n-
Brocade\n- HP Switches\n- Force 10 Switches\n- Dell PowerConnect Switches\n-
Extreme Networks\n- Enterasys\n- Screenos\n\nDocs\n----\n\n- The latest copy of
the docs are [archived
on the web][15]\n- There is also a [CiscoConfParse Tutorial][16]\n\nEditing
the Package\n-------------------\n\n- `git clone
https://github.com/mpenning/ciscoconfparse`\n- `cd ciscoconfparse`\n- `git
checkout -b develop`\n- Add / modify / delete on the `develop` branch\n-
`make test`\n- If tests run clean, `git commit` all the pending changes on
the `develop` branch\n- (as required) Edit the version number in
[pyproject.toml][12]\n- `git checkout main`\n- `git merge develop`\n-
`make test`\n- `make repo-push`\n- `make
pypi`\n\nPre-requisites\n--------------\n\n[The ciscoconfparse python
package][3] requires Python versions 3.7+ (note: Python version 3.7.0 has a bug
- ref [Github issue \\#117][18], but version 3.7.1 works); the OS should not
matter.\n\nInstallation and Downloads\n--------------------------\n\n- Use
`poetry` for Python3.x\\... :\n\n python -m pip install
ciscoconfparse\n\nIf you\\\'re interested in the source, you can always pull
from
the [github repo][17]:\n\n- Download from [the github repo][17]: :\n\n
git clone git://github.com/mpenning/ciscoconfparse\n cd
ciscoconfparse/\n python -m pip install .\n\nGithub Star
History\n-------------------\n\n[![Github Star History Chart][40]][40]\n\nOther
Resources\n---------------\n\n- [Dive into
Python3](http://www.diveintopython3.net/) is a good way to learn Python\n-
[Team CYMRU][30] has a [Secure IOS Template][29], which is especially useful
for external-facing routers / switches\n- [Cisco\\\'s Guide to hardening IOS
devices][31]\n- [Center for Internet Security Benchmarks][32] (An email
address, cookies, and javascript are required)\n\nBug Tracker and
Support\n-----------------------\n\n- Please report any suggestions, bug
reports, or annoyances with a [github bug report][24].\n- If you\\\'re having
problems with general python issues, consider searching for a solution on
[Stack Overflow][33]. If you can\\\'t find a solution for your problem or ne
ed more help, you can [ask on Stack Overflow][34] or [reddit/r/Python][39].\n-
If you\\\'re having problems with your Cisco devices, you can contact:\n -
[Cisco TAC][28]\n - [reddit/r/Cisco][35]\n - [reddit/r/networking][36]\n -
[NetworkEngineering.se][23]\n\nUnit-Tests\n----------\n\nThe project\\\'s [test
workflow][1] checks ciscoconfparse on Python versions 3.6 and higher, as well
as a [pypy JIT][22] executable.\n\nClick the image below for details; the
current build status is: [![Github unittest status][4]][5]\n\nLicense and
Copyright\n---------------------\n\n[ciscoconfparse][3] is licensed
[GPLv3][21]\n\n- Copyright (C) 2021-2022 David Michael Pennington\n- Copyright
(C) 2020-2021 David Michael Pennington at Cisco Systems (post-acquisition:
Cisco acquired ThousandEyes)\n- Copyright (C) 2019 David Michael Pennington at
ThousandEyes\n- Copyright (C) 2012-2019 David Michael Pennington at Samsung
Data Services\n- Copyright (C) 2011-2012 David Michael Pennington at Dell
Compute
r Corp\n- Copyright (C) 2007-2011 David Michael Pennington\n\nThe word
\\"Cisco\\" is a registered trademark of [Cisco
Systems][27].\n\nAuthor\n------\n\n[ciscoconfparse][3] was written by [David
Michael Pennington][25] (mike \\[\\~at\\~\\] pennington \\[.dot.\\] net).\n\n\n
[1]:
https://github.com/mpenning/ciscoconfparse/tree/master/.github/workflows\n
[2]: https://img.shields.io/pypi/v/ciscoconfparse.svg\n [3]:
https://pypi.python.org/pypi/ciscoconfparse/\n [4]:
https://github.com/mpenning/ciscoconfparse/actions/workflows/tests.yml/badge.svg\n
[5]: https://github.com/mpenning/ciscoconfparse/actions/workflows/tests.yml\n
[6]: https://pepy.tech/badge/ciscoconfparse\n [7]:
https://pepy.tech/project/ciscoconfparse\n [8]:
http://img.shields.io/badge/license-GPLv3-blue.svg\n [9]:
https://www.gnu.org/copyleft/gpl.html\n [10]: https://www.python.org\n [11]:
https://raw.githubusercontent.com/mpenning/ciscoconfparse/master/sphinx-doc/_static/ciscoconfparse_overview_75pct.png\n
[
12]: https://github.com/mpenning/ciscoconfparse/blob/main/pyproject.toml\n
[13]:
https://github.com/mpenning/ciscoconfparse/blob/master/configs/sample_01.junos\n
[14]: https://github.com/mpenning/ciscoconfparse/issues/17\n [15]:
http://www.pennington.net/py/ciscoconfparse/\n [16]:
http://pennington.net/tutorial/ciscoconfparse/ccp_tutorial.html\n [17]:
https://github.com/mpenning/ciscoconfparse\n [18]:
https://github.com/mpenning/ciscoconfparse/issues/117\n [19]:
https://github.com/mpenning/ciscoconfparse/issues/13\n [20]:
https://github.com/CrackerJackMack/\n [21]:
http://www.gnu.org/licenses/gpl-3.0.html\n [22]: https://pypy.org\n [23]:
https://networkengineering.stackexchange.com/\n [24]:
https://github.com/mpenning/ciscoconfparse/issues/new/choose\n [25]:
https://github.com/mpenning\n [26]: https://github.com/muir\n [27]:
https://www.cisco.com/\n [28]: https://www.cisco.com/go/support\n [29]:
https://www.cymru.com/Documents/secure-ios-template.html\n [30]: https
://team-cymru.com/company/\n [31]:
http://www.cisco.com/c/en/us/support/docs/ip/access-lists/13608-21.html\n
[32]: https://learn.cisecurity.org/benchmarks\n [33]:
https://stackoverflow.com\n [34]: http://stackoverflow.com/questions/ask\n
[35]: https://www.reddit.com/r/Cisco/\n [36]:
https://www.reddit.com/r/networking\n [37]:
https://snyk.io/advisor/python/ciscoconfparse/badge.svg\n [38]:
https://snyk.io/advisor/python/ciscoconfparse\n [39]:
https://www.reddit.com/r/Python/\n [40]:
https://api.star-history.com/svg?repos=mpenning/ciscoconfparse&type=Date\n
[41]: https://img.shields.io/github/commit-activity/m/mpenning/ciscoconfparse\n
[42]:
https://img.shields.io/github/commit-activity/m/mpenning/ciscoconfparse\n
[43]: https://www.codefactor.io/Content/badges/B.svg\n [44]:
https://www.codefactor.io/repository/github/mpenning/ciscoconfparse/\n',
+ 'long_description': 'ciscoconfparse\n==============\n\n[![Github unittest
workflow][4]][5] [![Code Health][37]][38] [![git commits][41]][42] [![Repo Code
Grade][43]][44] [![Version][2]][3] [![Downloads][6]][7]
[![License][8]][9]\n\n\nIntroduction: What is
ciscoconfparse?\n-------------------------------------\n\nShort answer:
ciscoconfparse is a [Python][10] library\nthat helps you quickly answer
questions like these about your\nCisco configurations:\n\n- What interfaces are
shutdown?\n- Which interfaces are in trunk mode?\n- What address and subnet
mask is assigned to each interface?\n- Which interfaces are missing a critical
command?\n- Is this configuration missing a standard config line?\n\nIt can
help you:\n\n- Audit existing router / switch / firewall / wlc
configurations\n- Modify existing configurations\n- Build new
configurations\n\nSpeaking generally, the library examines an IOS-style config
and breaks\nit into a set of linked parent / child relationships. You can per
form\ncomplex queries about these relationships.\n\n[![Cisco IOS config:
Parent / child][11]][11]\n\nUsage\n-----\n\nThe following code will parse a
configuration stored in\n\\\'exampleswitch.conf\\\' and select interfaces that
are shutdown.\n\n```python\nfrom ciscoconfparse import CiscoConfParse\n\nparse
= CiscoConfParse(\'exampleswitch.conf\', syntax=\'ios\')\n\nfor intf_obj in
parse.find_objects_w_child(\'^interface\', \'^\\s+shutdown\'):\n
print("Shutdown: " + intf_obj.text)\n```\n\nThe next example will find the IP
address assigned to interfaces.\n\n```python\nfrom ciscoconfparse import
CiscoConfParse\n\nparse = CiscoConfParse(\'exampleswitch.conf\',
syntax=\'ios\')\n\nfor intf_obj in parse.find_objects(\'^interface\'):\n\n
intf_name = intf_obj.re_match_typed(\'^interface\\s+(\\S.+?)$\')\n\n #
Search children of all interfaces for a regex match and return\n # the value
matched in regex match group 1. If there is no match,\n # return a default
value: \'\'\n in
tf_ip_addr = intf_obj.re_match_iter_typed(\n
r\'ip\\saddress\\s(\\d+\\.\\d+\\.\\d+\\.\\d+)\\s\', result_type=str,\n
group=1, default=\'\')\n print("{0}: {1}".format(intf_name,
intf_ip_addr))\n```\n\nWhat if we don\\\'t use
Cisco?\n----------------------------\n\nDon\\\'t let that stop you.\n\nAs of
CiscoConfParse 1.2.4, you can parse [brace-delimited configurations][13] into a
Cisco IOS style (see [Github Issue \\#17][14]), which means that CiscoConfParse
can parse these configurations:\n\n- Juniper Networks Junos\n- Palo Alto
Networks Firewall configurations\n- F5 Networks
configurations\n\nCiscoConfParse also handles anything that has a Cisco IOS
style of configuration, which includes:\n\n- Cisco IOS, Cisco Nexus, Cisco
IOS-XR, Cisco IOS-XE, Aironet OS, Cisco ASA, Cisco CatOS\n- Arista EOS\n-
Brocade\n- HP Switches\n- Force 10 Switches\n- Dell PowerConnect Switches\n-
Extreme Networks\n- Enterasys\n- Screenos\n\nDocs\n----\n\n- The latest copy of
the docs are [arc
hived on the web][15]\n- There is also a [CiscoConfParse
Tutorial][16]\n\nEditing the Package\n-------------------\n\n- `git clone
https://github.com/mpenning/ciscoconfparse`\n- `cd ciscoconfparse`\n- `git
checkout -b develop`\n- Add / modify / delete on the `develop` branch\n-
`make test`\n- If tests run clean, `git commit` all the pending changes on
the `develop` branch\n- (as required) Edit the version number in
[pyproject.toml][12]\n- `git checkout main`\n- `git merge develop`\n-
`make test`\n- `make repo-push`\n- `make
pypi`\n\nPre-requisites\n--------------\n\n[The ciscoconfparse python
package][3] requires Python versions 3.7+ (note: Python version 3.7.0 has a bug
- ref [Github issue \\#117][18], but version 3.7.1 works); the OS should not
matter.\n\nInstallation and Downloads\n--------------------------\n\n- Use
`poetry` for Python3.x\\... :\n\n python -m pip install
ciscoconfparse\n\nIf you\\\'re interested in the source, you can always pull
from the [github repo][17]:\n\n- Download from [the github repo][17]: :\n\n
git clone git://github.com/mpenning/ciscoconfparse\n cd
ciscoconfparse/\n python -m pip install .\n\nGithub Star
History\n-------------------\n\n[![Github Star History Chart][40]][40]\n\nOther
Resources\n---------------\n\n- [Dive into
Python3](http://www.diveintopython3.net/) is a good way to learn Python\n-
[Team CYMRU][30] has a [Secure IOS Template][29], which is especially useful
for external-facing routers / switches\n- [Cisco\\\'s Guide to hardening IOS
devices][31]\n- [Center for Internet Security Benchmarks][32] (An email
address, cookies, and javascript are required)\n\nBug Tracker and
Support\n-----------------------\n\n- Please report any suggestions, bug
reports, or annoyances with a [github bug report][24].\n- If you\\\'re having
problems with general python issues, consider searching for a solution on
[Stack Overflow][33]. If you can\\\'t find a solution for your problem
or need more help, you can [ask on Stack Overflow][34] or
[reddit/r/Python][39].\n- If you\\\'re having problems with your Cisco devices,
you can contact:\n - [Cisco TAC][28]\n - [reddit/r/Cisco][35]\n -
[reddit/r/networking][36]\n -
[NetworkEngineering.se][23]\n\nUnit-Tests\n----------\n\nThe project\\\'s [test
workflow][1] checks ciscoconfparse on Python versions 3.6 and higher, as well
as a [pypy JIT][22] executable.\n\nClick the image below for details; the
current build status is: [![Github unittest status][4]][5]\n\nLicense and
Copyright\n---------------------\n\n[ciscoconfparse][3] is licensed
[GPLv3][21]\n\n- Copyright (C) 2021-2022 David Michael Pennington\n- Copyright
(C) 2020-2021 David Michael Pennington at Cisco Systems (post-acquisition:
Cisco acquired ThousandEyes)\n- Copyright (C) 2019 David Michael Pennington at
ThousandEyes\n- Copyright (C) 2012-2019 David Michael Pennington at Samsung
Data Services\n- Copyright (C) 2011-2012 David Michael Pennington at Dell C
omputer Corp\n- Copyright (C) 2007-2011 David Michael Pennington\n\nThe word
\\"Cisco\\" is a registered trademark of [Cisco
Systems][27].\n\nAuthor\n------\n\n[ciscoconfparse][3] was written by [David
Michael Pennington][25] (mike \\[\\~at\\~\\] pennington \\[.dot.\\] net).\n\n\n
[1]:
https://github.com/mpenning/ciscoconfparse/tree/master/.github/workflows\n
[2]: https://img.shields.io/pypi/v/ciscoconfparse.svg\n [3]:
https://pypi.python.org/pypi/ciscoconfparse/\n [4]:
https://github.com/mpenning/ciscoconfparse/actions/workflows/tests.yml/badge.svg\n
[5]: https://github.com/mpenning/ciscoconfparse/actions/workflows/tests.yml\n
[6]: https://pepy.tech/badge/ciscoconfparse\n [7]:
https://pepy.tech/project/ciscoconfparse\n [8]:
http://img.shields.io/badge/license-GPLv3-blue.svg\n [9]:
https://www.gnu.org/copyleft/gpl.html\n [10]: https://www.python.org\n [11]:
https://raw.githubusercontent.com/mpenning/ciscoconfparse/master/sphinx-doc/_static/ciscoconfparse_overview_75pct.pn
g\n [12]:
https://github.com/mpenning/ciscoconfparse/blob/main/pyproject.toml\n [13]:
https://github.com/mpenning/ciscoconfparse/blob/master/configs/sample_01.junos\n
[14]: https://github.com/mpenning/ciscoconfparse/issues/17\n [15]:
http://www.pennington.net/py/ciscoconfparse/\n [16]:
http://pennington.net/tutorial/ciscoconfparse/ccp_tutorial.html\n [17]:
https://github.com/mpenning/ciscoconfparse\n [18]:
https://github.com/mpenning/ciscoconfparse/issues/117\n [19]:
https://github.com/mpenning/ciscoconfparse/issues/13\n [20]:
https://github.com/CrackerJackMack/\n [21]:
http://www.gnu.org/licenses/gpl-3.0.html\n [22]: https://pypy.org\n [23]:
https://networkengineering.stackexchange.com/\n [24]:
https://github.com/mpenning/ciscoconfparse/issues/new/choose\n [25]:
https://github.com/mpenning\n [26]: https://github.com/muir\n [27]:
https://www.cisco.com/\n [28]: https://www.cisco.com/go/support\n [29]:
https://www.cymru.com/Documents/secure-ios-template.html\n [30]:
https://team-cymru.com/company/\n [31]:
http://www.cisco.com/c/en/us/support/docs/ip/access-lists/13608-21.html\n
[32]: https://learn.cisecurity.org/benchmarks\n [33]:
https://stackoverflow.com\n [34]: http://stackoverflow.com/questions/ask\n
[35]: https://www.reddit.com/r/Cisco/\n [36]:
https://www.reddit.com/r/networking\n [37]:
https://snyk.io/advisor/python/ciscoconfparse/badge.svg\n [38]:
https://snyk.io/advisor/python/ciscoconfparse\n [39]:
https://www.reddit.com/r/Python/\n [40]:
https://api.star-history.com/svg?repos=mpenning/ciscoconfparse&type=Date\n
[41]: https://img.shields.io/github/commit-activity/m/mpenning/ciscoconfparse\n
[42]:
https://img.shields.io/github/commit-activity/m/mpenning/ciscoconfparse\n
[43]: https://www.codefactor.io/Content/badges/B.svg\n [44]:
https://www.codefactor.io/repository/github/mpenning/ciscoconfparse/\n',
'author': 'Mike Pennington',
'author_email': '[email protected]',
'maintainer': 'None',