Bug Description
Calling str() on a parsed named IOS ACL raises TypeError: ACL.output_ios_named() got an unexpected keyword argument 'family'. Every named ACL parsed via trigger.acl.parse() is affected whenever it is rendered to a string (including any code path that logs, serializes, or round-trips an ACL).
Steps to Reproduce
from trigger.acl import parse
acl = parse("""ip access-list extended SMOKE
permit tcp host 10.20.30.40 any eq 22
permit udp 10.0.0.0 0.255.255.255 any eq 161
deny ip any any log
""")
print(str(acl)) # boom
Actual Behavior
TypeError: ACL.output_ios_named() got an unexpected keyword argument 'family'
Expected Behavior
The ACL should render in IOS named format.
Root Cause
The call chain breaks like this:
ACL.__str__ (trigger/acl/support.py:696) calls self.output(format=self.format, family=self.family)
ACL.output (line 702) forwards **kwargs to getattr(self, "output_" + format)(*largs, **kwargs)
ACL.output_ios_named(self, replace=False) (line 815) does not accept family → TypeError
Note the inconsistency elsewhere in the same file:
ACL.output_junos(self, replace=False, family=None) (line 704) correctly accepts family — JunOS output works.
- The term-level
output_ios_named(self, prefix="", *args, **kwargs) (line 1072) tolerates extra kwargs — only the ACL-level method is broken.
Affected Versions
Confirmed present in v2.3.1 (48cc719) as well as current main — verified by running the repro against the release tag. Not a regression from any recent dependency bump.
Suggested Fix
One-liner: def output_ios_named(self, replace=False, family=None): — accept and ignore family, since IOS named format has no family inet/inet6 wrapping (that's JunOS-only). The test suite currently doesn't exercise str() on a named IOS ACL, so a regression test would be worthwhile.
Environment
- Python 3.11.14, macOS (Apple Silicon)
- trigger 2.3.1 and main@79d5362
- Discovered during a post-dependency-bump smoke test (full test suite otherwise passes 191/191)
Bug Description
Calling
str()on a parsed named IOS ACL raisesTypeError: ACL.output_ios_named() got an unexpected keyword argument 'family'. Every named ACL parsed viatrigger.acl.parse()is affected whenever it is rendered to a string (including any code path that logs, serializes, or round-trips an ACL).Steps to Reproduce
Actual Behavior
Expected Behavior
The ACL should render in IOS named format.
Root Cause
The call chain breaks like this:
ACL.__str__(trigger/acl/support.py:696) callsself.output(format=self.format, family=self.family)ACL.output(line 702) forwards**kwargstogetattr(self, "output_" + format)(*largs, **kwargs)ACL.output_ios_named(self, replace=False)(line 815) does not acceptfamily→TypeErrorNote the inconsistency elsewhere in the same file:
ACL.output_junos(self, replace=False, family=None)(line 704) correctly acceptsfamily— JunOS output works.output_ios_named(self, prefix="", *args, **kwargs)(line 1072) tolerates extra kwargs — only the ACL-level method is broken.Affected Versions
Confirmed present in v2.3.1 (48cc719) as well as current
main— verified by running the repro against the release tag. Not a regression from any recent dependency bump.Suggested Fix
One-liner:
def output_ios_named(self, replace=False, family=None):— accept and ignorefamily, since IOS named format has nofamily inet/inet6wrapping (that's JunOS-only). The test suite currently doesn't exercisestr()on a named IOS ACL, so a regression test would be worthwhile.Environment