From: Kyr Shatskyy Date: Tue, 23 Jul 2024 18:11:23 +0000 (+0200) Subject: mgr/rook: fix ivalid escape sequence X-Git-Tag: v20.0.0~1346^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b91f8ecede6b7cfadd453169559fde7c849c5ba;p=ceph.git mgr/rook: fix ivalid 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/rook/rook_cluster.py:110: DeprecationWarning: invalid escape sequence '\d' coeff_and_unit = re.search('(\d+)(\D+)', size_str) 1. https://docs.python.org/3/library/re.html Signed-off-by: Kyr Shatskyy --- diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index 16d498a70e3..be1b637a309 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -120,7 +120,7 @@ class DefaultFetcher(): def convert_size(self, size_str: str) -> int: units = ("", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "", "K", "M", "G", "T", "P", "E") - coeff_and_unit = re.search('(\d+)(\D+)', size_str) + coeff_and_unit = re.search(r'(\d+)(\D+)', size_str) assert coeff_and_unit is not None coeff = int(coeff_and_unit[1]) unit = coeff_and_unit[2]