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 <kyrylo.shatskyy@clyso.com>
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]