summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-19 09:06:34 +0200
committerGitHub <noreply@github.com>2021-09-19 09:06:34 +0200
commit1ea678753355726a39cabfcc1cc54f1c01bd87e3 (patch)
tree9330fe4e96049e097bcbaea25c9d22be6c9b48dc /src/op_mode
parent8043764dd2365594fb478d9c62f35a11290cb7be (diff)
parent425eabea7c82992ab1319b9adb0e9d21172b255d (diff)
downloadvyos-1x-1ea678753355726a39cabfcc1cc54f1c01bd87e3.tar.gz
vyos-1x-1ea678753355726a39cabfcc1cc54f1c01bd87e3.zip
Merge pull request #1011 from jack9603301/T3648
op-mode: nat: T3648: Fix NAT script errors
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/show_nat_rules.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/op_mode/show_nat_rules.py b/src/op_mode/show_nat_rules.py
index 4a059c848..d68def26a 100755
--- a/src/op_mode/show_nat_rules.py
+++ b/src/op_mode/show_nat_rules.py
@@ -69,7 +69,7 @@ if args.source or args.destination:
srcdest = ''
srcdests = []
tran_addr = ''
- for i in range(1,len(data['expr']) + 1):
+ for i in range(1,len(data['expr']) ):
srcdest_json = dict_search('match.right', data['expr'][i])
if srcdest_json:
if isinstance(srcdest_json,str):
@@ -113,7 +113,7 @@ if args.source or args.destination:
srcdest = ''
print(format_nat_rule.format(rule, srcdests[0], tran_addr, interface))
- for i in range(1, list(srcdest)):
+ for i in range(1, len(srcdests)):
print(format_nat_rule.format(' ', srcdests[i], ' ', ' '))
exit(0)