Skip to content

Commit 1afd5b7

Browse files
authored
Merge pull request ceph#58767 from kshtsk/wip-python-invalid-escape-sequence
mgr: fix invalid escape sequence Reviewed-by: John Mulligan <[email protected]>
2 parents 01a9f08 + 6dfb20b commit 1afd5b7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/pybind/mgr/osd_perf_query/module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class OSDPerfQuery(MgrModule):
5858
'key_descriptor': [
5959
{'type': 'pool_id', 'regex': '^(.+)$'},
6060
{'type': 'object_name',
61-
'regex': '^(?:rbd|journal)_data\.(?:([0-9]+)\.)?([^.]+)\.'},
61+
'regex': r'^(?:rbd|journal)_data\.(?:([0-9]+)\.)?([^.]+)\.'},
6262
],
6363
'performance_counter_descriptors': [
6464
'bytes', 'write_ops', 'read_ops', 'write_bytes', 'read_bytes',

src/pybind/mgr/rook/rook_cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def fetch(self) -> None:
120120

121121
def convert_size(self, size_str: str) -> int:
122122
units = ("", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "", "K", "M", "G", "T", "P", "E")
123-
coeff_and_unit = re.search('(\d+)(\D+)', size_str)
123+
coeff_and_unit = re.search(r'(\d+)(\D+)', size_str)
124124
assert coeff_and_unit is not None
125125
coeff = int(coeff_and_unit[1])
126126
unit = coeff_and_unit[2]

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)