summaryrefslogtreecommitdiff
path: root/src/conf_mode/load-balancing_haproxy.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-04-28 22:08:08 +0200
committerChristian Breunig <christian@breunig.cc>2025-04-28 22:10:08 +0200
commit6abf68da33aa71913872730e24396f366c4dc9fa (patch)
tree40604b03792c565f5003d5ad0d655ea5548f96f2 /src/conf_mode/load-balancing_haproxy.py
parentb93427874a0e502f83c3cc450663e079af214ea9 (diff)
downloadvyos-1x-6abf68da33aa71913872730e24396f366c4dc9fa.tar.gz
vyos-1x-6abf68da33aa71913872730e24396f366c4dc9fa.zip
haproxy: T7122: do not use f'ormat strings without variable
Diffstat (limited to 'src/conf_mode/load-balancing_haproxy.py')
-rw-r--r--src/conf_mode/load-balancing_haproxy.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/conf_mode/load-balancing_haproxy.py b/src/conf_mode/load-balancing_haproxy.py
index 16c9300c2..92bf818dc 100644
--- a/src/conf_mode/load-balancing_haproxy.py
+++ b/src/conf_mode/load-balancing_haproxy.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2023-2024 VyOS maintainers and contributors
+# Copyright (C) 2023-2025 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
@@ -65,7 +65,7 @@ def verify(lb):
return None
if 'backend' not in lb or 'service' not in lb:
- raise ConfigError(f'"service" and "backend" must be configured!')
+ raise ConfigError('Both "service" and "backend" must be configured!')
for front, front_config in lb['service'].items():
if 'port' not in front_config:
@@ -76,7 +76,7 @@ def verify(lb):
tmp_port = front_config['port']
if check_port_availability(tmp_address, int(tmp_port), 'tcp') is not True and \
not is_listen_port_bind_service(int(tmp_port), 'haproxy'):
- raise ConfigError(f'"TCP" port "{tmp_port}" is used by another service')
+ raise ConfigError(f'TCP port "{tmp_port}" is used by another service')
if 'http_compression' in front_config:
if front_config['mode'] != 'http':
@@ -89,12 +89,12 @@ def verify(lb):
if 'http_check' in back_config:
http_check = back_config['http_check']
if 'expect' in http_check and 'status' in http_check['expect'] and 'string' in http_check['expect']:
- raise ConfigError(f'"expect status" and "expect string" can not be configured together!')
+ raise ConfigError('"expect status" and "expect string" can not be configured together!')
if 'health_check' in back_config:
if back_config['mode'] != 'tcp':
raise ConfigError(f'backend "{back}" can only be configured with {back_config["health_check"]} ' +
- f'health-check whilst in TCP mode!')
+ 'health-check whilst in TCP mode!')
if 'http_check' in back_config:
raise ConfigError(f'backend "{back}" cannot be configured with both http-check and health-check!')
@@ -198,7 +198,6 @@ def apply(lb):
call(f'systemctl stop {systemd_service}')
else:
call(f'systemctl reload-or-restart {systemd_service}')
-
return None