From: Michael Fritch Date: Thu, 12 Dec 2019 15:10:44 +0000 (-0700) Subject: cephadm: use raw string during `re.sub` X-Git-Tag: v15.1.0~525^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b27bef96e3f13213f5e37b33e45f08b1b9eaafb6;p=ceph-ci.git cephadm: use raw string during `re.sub` cephadm:198: DeprecationWarning: invalid escape sequence \s nice_conf = re.sub('\n(\s)+', '\n', raw_conf) Signed-off-by: Michael Fritch --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index f0eaf407a0c..6c87501c9a0 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -195,14 +195,14 @@ def read_config(fn): if fn: with open(fn, 'r') as f: raw_conf = f.read() - nice_conf = re.sub('\n(\s)+', '\n', raw_conf) + nice_conf = re.sub(r'\n(\s)+', r'\n', raw_conf) s_io = StringIO(nice_conf) if sys.version_info >= (3, 2): cp.read_file(s_io) else: cp.readfp(s_io) - return cp + return cp def pathify(p): # type: (str) -> str