diff options
author | jack9603301 <jack9603301@163.com> | 2021-09-19 13:34:41 +0800 |
---|---|---|
committer | jack9603301 <jack9603301@163.com> | 2021-09-19 13:34:41 +0800 |
commit | 425eabea7c82992ab1319b9adb0e9d21172b255d (patch) | |
tree | 83e54644979507f93b34d2d79d9872087bd813bf | |
parent | ae2dc55aa68679e828d4bb133fc515172c081d0f (diff) | |
download | vyos-1x-425eabea7c82992ab1319b9adb0e9d21172b255d.tar.gz vyos-1x-425eabea7c82992ab1319b9adb0e9d21172b255d.zip |
op-mode: nat: T3648: Fix NAT script errors
-rwxr-xr-x | src/op_mode/show_nat_rules.py | 4 |
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) |