From f9b30d0af4d4c8bd7dd9baecf6d6dbdc6b5d9a30 Mon Sep 17 00:00:00 2001 From: gyptazy Date: Sat, 9 Nov 2024 09:35:21 +0100 Subject: [PATCH] Fix maintenance mode when using cli arg and config mode by using the merged list. Sponsored-by: @CartCaved Fixes: #119 --- .changelogs/1.0.6/119_fix_maintenance_mode_cli_and_config.yml | 2 ++ proxlb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .changelogs/1.0.6/119_fix_maintenance_mode_cli_and_config.yml diff --git a/.changelogs/1.0.6/119_fix_maintenance_mode_cli_and_config.yml b/.changelogs/1.0.6/119_fix_maintenance_mode_cli_and_config.yml new file mode 100644 index 0000000..d68ec5d --- /dev/null +++ b/.changelogs/1.0.6/119_fix_maintenance_mode_cli_and_config.yml @@ -0,0 +1,2 @@ +fixed: + - Fix maintenance mode when using cli arg and config mode by using the merged list (by @CartCaved). [#119] diff --git a/proxlb b/proxlb index 609046b..c888161 100755 --- a/proxlb +++ b/proxlb @@ -880,7 +880,7 @@ def balancing_vm_maintenance(proxlb_config, app_args, node_statistics, vm_statis maintenance_nodes_list = maintenance_nodes_list + app_args.maintenance.split(',') # Ensure that only existing nodes in the cluster will be used. - if len(proxlb_config['vm_maintenance_nodes']) > 1: + if len(maintenance_nodes_list) > 1: maintenance_nodes_list = set(maintenance_nodes_list) & set(nodes_present) logging.info(f'{info_prefix} Maintenance mode for the following hosts defined: {maintenance_nodes_list}') else: