From 1bc5b5143983a12a69ea84de09e542a2ba75c5bd Mon Sep 17 00:00:00 2001 From: chapeau Date: Sun, 29 Nov 2020 22:37:42 +0100 Subject: [PATCH] a few small fixes --- freeradius_utils/auth.py | 6 ++---- re2o/acl.py | 1 + re2o/mixins.py | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/freeradius_utils/auth.py b/freeradius_utils/auth.py index 328d2cd0..7c32f05c 100644 --- a/freeradius_utils/auth.py +++ b/freeradius_utils/auth.py @@ -193,9 +193,7 @@ def post_auth(data): if switch: # For logging sw_name = switch["name"] or "?" - room = "Unknown port" - if port: - room = port["room"] or "Unknown room" + room = port["room"] or "Unknown room" if port else "Unknown port" out = decide_vlan_switch(data_from_api, mac, nas_port) reason, vlan_id, decision, attributes = out @@ -388,7 +386,7 @@ def decide_vlan_switch(data_from_api, user_mac, nas_port): # If a vlan is precised in port config, we use it if port_profile["vlan_untagged"]: DECISION_VLAN = int(port_profile["vlan_untagged"]["vlan_id"]) - extra_log = "Force sur vlan " + str(DECISION_VLAN) + extra_log = "Force sur vlan %s" % str(DECISION_VLAN) attributes = () else: DECISION_VLAN = radius_option["vlan_decision_ok"]["vlan_id"] diff --git a/re2o/acl.py b/re2o/acl.py index d1d2c3a9..72633256 100644 --- a/re2o/acl.py +++ b/re2o/acl.py @@ -6,6 +6,7 @@ # Copyright © 2017 Gabriel Détraz # Copyright © 2017 Lara Kermarec # Copyright © 2017 Augustin Lemesle +# Copyright © 2020 Corentin Canebier # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/re2o/mixins.py b/re2o/mixins.py index ddc827b6..e0ce3310 100644 --- a/re2o/mixins.py +++ b/re2o/mixins.py @@ -5,6 +5,7 @@ # # Copyright © 2018 Gabriel Détraz # Copyright © 2017 Charlie Jacomme +# Copyright © 2020 Corentin Canebier # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by