Skip to content

Commit

Permalink
Version 0.7.33
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenning committed Mar 17, 2024
1 parent bb42bd3 commit 22dc162
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

## Version: 0.7.32

- Released: 2024-03-17
- Summary:
- Add `options_ios.hier_config.yml`

## Version: 0.7.32

- Released: 2024-03-17
- Summary:
- Update tests
Expand Down
2 changes: 1 addition & 1 deletion ciscoconfparse2/ciscoconfparse2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3703,7 +3703,7 @@ def __init__(self,
# _ represents ios options as a dict... for now we use an empty
# dict below...
try:
_ = yaml.load(open('./options_ios.yml'), Loader=yaml.SafeLoader)
_ = yaml.load(open('./options_ios.hier_config.yml'), Loader=yaml.SafeLoader)
except FileNotFoundError:
pass

Expand Down
123 changes: 123 additions & 0 deletions options_ios.hier_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
---
#############################################################
# heir_config yml file
#############################################################
# Indicates the style of the configuration
style: ios

# if there is a delta, negate the parents and re-write the parents with children
sectional_overwrite: []

# if there is a delta, overwrite these parents instead of one of their children
sectional_overwrite_no_negate: []

# The default order value is 500, with a range between 1 - 999.
# Commands with smaller order values float to the top in the order of execution.
# Commands with larger order values float to the bottom in the order of execution.
# Syntax Example:
# - lineage:
# - startswith:
# - no route-map
# order: 600
ordering:
- lineage:
- startswith: no vlan filter
order: 700
- lineage:
- startswith: interface
- startswith: no shutdown
order: 700

# adds +1 indent to lines following start_expression and removes the +1 indent for lines following end_expression
indent_adjust: []

parent_allows_duplicate_child: []

sectional_exiting:
# This rule is used in the hierarchical_configuration unit test for .add_section_exiting()
- lineage:
- startswith: router bgp
- startswith: template peer-policy
exit_text: exit-peer-policy
- lineage:
- startswith: router bgp
- startswith: template peer-session
exit_text: exit-peer-session
- lineage:
- startswith: router bgp
- startswith: address-family
exit_text: exit-address-family

# substitions against the full multi-line config text
full_text_sub: []
#- search: 'banner\s(exec|motd)\s(\S)\n(.*\n){1,}(\2)'
# replace: ''
#- search: 'banner\s(exec|motd)\s(\S.).+\n(.*\n){1,}.*(\2)'
# replace: ''
#- search: 'banner\s(exec|motd)\s(\S.)\n(.*\n){1,}(\2)'
# replace: ''

# substitions against each line of the config text
per_line_sub:
- search: ^Building configuration.*
replace: ''
- search: ^Current configuration.*
replace: ''
- search: ^! Last configuration change.*
replace: ''
- search: ^! NVRAM config last updated.*
replace: ''
- search: ^ntp clock-period .*
replace: ''
- search: ^version.*
replace: ''
- search: ^ logging event link-status$
replace: ''
- search: ^ logging event subif-link-status$
replace: ''
- search: ^\s*ipv6 unreachables disable$
replace: ''
- search: ^end$
replace: ''
- search: '^\s*[#!].*'
replace: ''
- search: ^ no ip address
replace: ''
- search: ^ exit-peer-policy
replace: ''
- search: ^ exit-peer-session
replace: ''
- search: ^ exit-address-family
replace: ''
- search: ^crypto key generate rsa general-keys.*$
replace: ''

idempotent_commands_blacklist: []

# These commands do not require negation, they simply overwrite themselves
# Example Syntax
# - lineage:
# - startswith: interface
# - startswith: description
idempotent_commands:
- lineage:
- startswith: vlan
- startswith: name
- lineage:
- startswith: interface
- startswith: description
- lineage:
- startswith: interface
- startswith: ip address

# Default when expression: list of expressions
negation_default_when: []

# Negate substitutions: expression -> negate with
# Example Syntax:
# - lineage:
# - startswith: route-map
# - startswith: description
# use: no description
negation_negate_with: []

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[project]
name = "ciscoconfparse2"
version = "0.7.32"
version = "0.7.33"
description = "Parse, Audit, Query, Build, and Modify Cisco IOS-style and JunOS-style configs"
readme = "README.md"
license = "GPL-3.0-only"
Expand Down

0 comments on commit 22dc162

Please sign in to comment.