Skip to content

Commit 6dfb20b

Browse files
author
Kyr Shatskyy
committed
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 <[email protected]>
1 parent 6b91f8e commit 6dfb20b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pybind/mgr/zabbix/module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def _parse_zabbix_hosts(self) -> None:
131131
self._zabbix_hosts = list()
132132
servers = cast(str, self.config['zabbix_host']).split(",")
133133
for server in servers:
134-
uri = re.match("(?:(?:\[?)([a-z0-9-\.]+|[a-f0-9:\.]+)(?:\]?))(?:((?::))([0-9]{1,5}))?$", server)
134+
uri = re.match(r"(?:(?:\[?)([a-z0-9-\.]+|[a-f0-9:\.]+)(?:\]?))(?:((?::))([0-9]{1,5}))?$", server)
135135
if uri:
136136
zabbix_host, sep, opt_zabbix_port = uri.groups()
137137
if sep == ':':

0 commit comments

Comments
 (0)