Skip to content

Commit

Permalink
Merge pull request #146 from netdevops/issue-145-v3
Browse files Browse the repository at this point in the history
Addresses Issue 145 in in V3
  • Loading branch information
jtdub authored Jan 14, 2025
2 parents 7feffeb + 19f053f commit df40787
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 160 deletions.
3 changes: 0 additions & 3 deletions hier_config/platforms/arista_eos/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ def _instantiate_rules() -> HConfigDriverRules:
MatchRule(re_search="neighbor \\S+ description"),
),
),
IdempotentCommandsRule(
match_rules=(MatchRule(startswith="snmp-server community"),),
),
IdempotentCommandsRule(
match_rules=(MatchRule(startswith="snmp-server location"),),
),
Expand Down
2 changes: 1 addition & 1 deletion hier_config/platforms/cisco_ios/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def location(self) -> str:

@property
def stack_members(self) -> Iterable[StackMember]:
"""stacking
"""Stacking
member 1 type "JL123" mac-address abc123-abc123
member 1 priority 255
member 2 type "JL123" mac-address abc123-abc123
Expand Down
3 changes: 0 additions & 3 deletions hier_config/platforms/cisco_nxos/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,6 @@ def _instantiate_rules() -> HConfigDriverRules:
IdempotentCommandsRule(
match_rules=(MatchRule(startswith="mac address-table aging-time"),),
),
IdempotentCommandsRule(
match_rules=(MatchRule(startswith="snmp-server community"),),
),
IdempotentCommandsRule(
match_rules=(MatchRule(startswith="snmp-server location"),)
),
Expand Down
3 changes: 0 additions & 3 deletions hier_config/platforms/cisco_xr/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,6 @@ def _instantiate_rules() -> HConfigDriverRules:
MatchRule(startswith="ipv4 address"),
),
),
IdempotentCommandsRule(
match_rules=(MatchRule(startswith="snmp-server community"),),
),
IdempotentCommandsRule(
match_rules=(MatchRule(startswith="snmp-server location"),),
),
Expand Down
2 changes: 1 addition & 1 deletion hier_config/platforms/hp_procurve/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def location(self) -> str:

@property
def stack_members(self) -> Iterable[StackMember]:
"""stacking
"""Stacking
member 1 type "JL123" mac-address abc123-abc123
member 1 priority 255
member 2 type "JL123" mac-address abc123-abc123
Expand Down
290 changes: 148 additions & 142 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hier-config"
version = "3.2.1"
version = "3.2.2"
description = "A network configuration query and comparison library, used to build remediation configurations."
packages = [
{ include="hier_config", from="."},
Expand Down Expand Up @@ -146,6 +146,7 @@ ignore = [
# These can be re-enabled once we deprecate Python 3.9
"FA100", # future-rewritable-type-annotation
"UP007", # non-pep604-annotation
"UP045", # Use `X | None` for type annotations
]

[tool.ruff.lint.flake8-pytest-style]
Expand Down
12 changes: 6 additions & 6 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ def test_load_hier_config_tags_success(tags_file_path: str) -> None:
assert isinstance(result, tuple), "Result should be a tuple of TagRule objects."
assert len(result) == 4, "There should be four TagRule objects."
assert isinstance(result[0], TagRule), "Each element should be a TagRule object."
assert result[0].apply_tags == {
"safe"
}, "First tag should have 'safe' as an applied tag."
assert result[3].apply_tags == {
"manual"
}, "Last tag should have 'manual' as an applied tag."
assert result[0].apply_tags == {"safe"}, (
"First tag should have 'safe' as an applied tag."
)
assert result[3].apply_tags == {"manual"}, (
"Last tag should have 'manual' as an applied tag."
)


def test_load_hier_config_tags_file_not_found() -> None:
Expand Down

0 comments on commit df40787

Please sign in to comment.