Page MenuHomeVyOS Platform

show firewall name <name> - Can't use .items() on a list
Closed, ResolvedPublicBUG

Description

https://github.com/vyos/vyos-1x/blob/current/src/op_mode/firewall.py#L66

firewall['interface'] = []

needs to be

firewall['interface'] = {}

otherwise you end up with, when you try to do show firewall name <name>

Traceback (most recent call last):
Rule Information
  File "/usr/libexec/vyos/op_mode/firewall.py", line 343, in <module>
    show_firewall_rule(args.name, args.rule, args.ipv6)
  File "/usr/libexec/vyos/op_mode/firewall.py", line 224, in show_firewall_rule
    firewall = get_config_firewall(conf, name, ipv6)
  File "/usr/libexec/vyos/op_mode/firewall.py", line 76, in get_config_firewall
    get_firewall_interfaces(firewall, name, ipv6)
  File "/usr/libexec/vyos/op_mode/firewall.py", line 31, in get_firewall_interfaces
    for ifname, if_conf in firewall['interface'].items():
AttributeError: 'list' object has no attribute 'items'

Details

Difficulty level
Easy (less than an hour)
Version
VyOS 1.4-rolling-202210280218
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)