From 425eabea7c82992ab1319b9adb0e9d21172b255d Mon Sep 17 00:00:00 2001 From: jack9603301 Date: Sun, 19 Sep 2021 13:34:41 +0800 Subject: op-mode: nat: T3648: Fix NAT script errors --- src/op_mode/show_nat_rules.py | 4 ++-- 1 file 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) -- cgit v1.2.3