From 6dfb20b2c3cd4fd0d9c94964008a679f2e535f4e Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Tue, 23 Jul 2024 20:17:13 +0200 Subject: [PATCH] mgr/zabbix: fix invalid escape sequence Get rid of DepricationWarning which, according to [1], is going to become a SyntaxError: /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr/zabbix/module.py:134: DeprecationWarning: invalid escape sequence '\[' uri = re.match("(?:(?:\[?)([a-z0-9-\.]+|[a-f0-9:\.]+)(?:\]?))(?:((?::))([0-9]{1,5}))?$", server) 1. https://docs.python.org/3.11/library/re.html Signed-off-by: Kyr Shatskyy --- src/pybind/mgr/zabbix/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/zabbix/module.py b/src/pybind/mgr/zabbix/module.py index 638b688562f..2e348ab0391 100644 --- a/src/pybind/mgr/zabbix/module.py +++ b/src/pybind/mgr/zabbix/module.py @@ -131,7 +131,7 @@ class Module(MgrModule): self._zabbix_hosts = list() servers = cast(str, self.config['zabbix_host']).split(",") for server in servers: - uri = re.match("(?:(?:\[?)([a-z0-9-\.]+|[a-f0-9:\.]+)(?:\]?))(?:((?::))([0-9]{1,5}))?$", server) + uri = re.match(r"(?:(?:\[?)([a-z0-9-\.]+|[a-f0-9:\.]+)(?:\]?))(?:((?::))([0-9]{1,5}))?$", server) if uri: zabbix_host, sep, opt_zabbix_port = uri.groups() if sep == ':': -- 2.39.5