summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorNicolas Fort <nicolasfort1988@gmail.com>2023-07-31 13:09:31 +0000
committerNicolas Fort <nicolasfort1988@gmail.com>2023-07-31 18:19:45 +0000
commit7ae9d8953ddc9ba38d62400187ce1ec44abb5a6e (patch)
treea278337f9a02bd37ccc5c588198fe96c9e57f121 /python
parentb7825f1f2b9b3ff7d25e8e072d60db7b70fa250a (diff)
downloadvyos-1x-7ae9d8953ddc9ba38d62400187ce1ec44abb5a6e.tar.gz
vyos-1x-7ae9d8953ddc9ba38d62400187ce1ec44abb5a6e.zip
T5014: fix conflicts. Add code for redirection, which is causing conflicts. Change code for new syntax
Diffstat (limited to 'python')
-rw-r--r--python/vyos/nat.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/vyos/nat.py b/python/vyos/nat.py
index 9978993a7..a56ca1ff3 100644
--- a/python/vyos/nat.py
+++ b/python/vyos/nat.py
@@ -90,12 +90,12 @@ def parse_nat_rule(rule_conf, rule_id, nat_type, ipv6=False):
if options:
translation_str += f' {",".join(options)}'
- if 'member' in rule_conf['balance']:
+ if 'backend' in rule_conf['load_balance']:
hash_input_items = []
current_prob = 0
nat_map = []
- for trans_addr, addr in rule_conf['balance']['member'].items():
+ for trans_addr, addr in rule_conf['load_balance']['backend'].items():
item_prob = int(addr['weight'])
upper_limit = current_prob + item_prob - 1
hash_val = str(current_prob) + '-' + str(upper_limit)
@@ -105,10 +105,10 @@ def parse_nat_rule(rule_conf, rule_id, nat_type, ipv6=False):
elements = ' , '.join(nat_map)
- if 'hash' in rule_conf['balance'] and 'random' in rule_conf['balance']['hash']:
+ if 'hash' in rule_conf['load_balance'] and 'random' in rule_conf['load_balance']['hash']:
translation_str += ' numgen random mod 100 map ' + '{ ' + f'{elements}' + ' }'
else:
- for input_param in rule_conf['balance']['hash']:
+ for input_param in rule_conf['load_balance']['hash']:
if input_param == 'source-address':
param = 'ip saddr'
elif input_param == 'destination-address':