summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-07-02 19:51:17 +0200
committerGitHub <noreply@github.com>2023-07-02 19:51:17 +0200
commit687c963ebd64bb030c8feed0a873ecb66b88ca22 (patch)
treecd35800771793f7570aa6b912946b1af2242fcfc
parent1a6640a7443410b667818a3545c306ea451cd137 (diff)
parent3596d3e5d6d20ebb46a4b9365108280325839ef0 (diff)
downloadvyos-1x-687c963ebd64bb030c8feed0a873ecb66b88ca22.tar.gz
vyos-1x-687c963ebd64bb030c8feed0a873ecb66b88ca22.zip
Merge pull request #2067 from sever-sever/T5332
T5332: Fix show policy route without attahed interface
-rwxr-xr-xsrc/op_mode/policy_route.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/op_mode/policy_route.py b/src/op_mode/policy_route.py
index 5953786f3..fae47adec 100755
--- a/src/op_mode/policy_route.py
+++ b/src/op_mode/policy_route.py
@@ -61,8 +61,10 @@ def output_policy_route(name, route_conf, ipv6=False, single_rule_id=None):
ip_str = 'IPv6' if ipv6 else 'IPv4'
print(f'\n---------------------------------\n{ip_str} Policy Route "{name}"\n')
- if route_conf['interface']:
+ if route_conf.get('interface'):
print('Active on: {0}\n'.format(" ".join(route_conf['interface'])))
+ else:
+ print('Inactive - Not applied to any interfaces\n')
details = get_nftables_details(name, ipv6)
rows = []