if no radius in global config get it from switch config

This commit is contained in:
mikachu 2020-10-05 19:50:41 +02:00
parent cb97a4f412
commit 3f7450c71a

View file

@ -278,6 +278,8 @@ def gen_conf_re2o(re2o_config, header, modules):
interfaces.sort(key=lambda x: x["number"])
radius_key = re2o_config.get("get_radius_key_value")
radius_servers = [ {"ip": i, "secret": radius_key } for i in mgmt_utils["radius_servers"]["ipv4"] + mgmt_utils["radius_servers"]["ipv6"]]
if radius_servers == []:
radius_servers = [ {"ip": i, "secret": radius_key } for i in re2o_config["get_radius_servers"]["ipv4"] + mgmt_utils["radius_servers"]["ipv6"]]
config_dict = {
"header": header,
"modules": modules,