From cb16068ccde3b39f2e0e2aa450da7df55f782c1c Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 3 Jan 2021 09:18:31 +0100 Subject: dhcp: T3180: bugfix NameError when slicing server ranges Introduced in commit e46def834483e ("dhcp: T3100: re-add range slicing support when exclude addresses are used") by not obeying the move from list to dict and still relying on the old list names variables. --- src/conf_mode/dhcp_server.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/dhcp_server.py b/src/conf_mode/dhcp_server.py index 1ab2d8d16..fee2afe24 100755 --- a/src/conf_mode/dhcp_server.py +++ b/src/conf_mode/dhcp_server.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2018-2020 VyOS maintainers and contributors +# Copyright (C) 2018-2021 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -89,11 +89,11 @@ def dhcp_slice_range(exclude_list, range_dict): if not (ip_address(r['start']) > ip_address(r['stop'])): output.append(r) else: - # if we have no exclude in the whole range - we just take the range - # as it is + # if the excluded address was not part of the range, we simply return + # the entire ranga again if not range_last_exclude: - if ra not in output: - output.append(ra) + if range_dict not in output: + output.append(range_dict) return output -- cgit v1.2.3