From: Varsha Rao Date: Mon, 13 May 2019 12:00:01 +0000 (+0530) Subject: cephfs-shell: Fix flake8 invalid escape sequence warning X-Git-Tag: v15.1.0~2668^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c7d217c2afcb9cdc64356f6a6b1f8f701c7814d9;p=ceph-ci.git cephfs-shell: Fix flake8 invalid escape sequence warning Backslash-character pair is not a valid escape sequence, since Python 3.6 version. Prefixing character 'r' to the escape sequence, fixes the warning. Fixes: https://tracker.ceph.com/issues/39717 Signed-off-by: Varsha Rao --- diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 102e61bd74c..2c012f82965 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -566,7 +566,7 @@ exists.') else: for src_dir, dirs, files in os.walk(root_src_dir): dst_dir = src_dir.replace(root_src_dir, root_dst_dir, 1) - dst_dir = re.sub('\/+', '/', cephfs.getcwd().decode('utf-8') + dst_dir) + dst_dir = re.sub(r'\/+', '/', cephfs.getcwd().decode('utf-8') + dst_dir) if args.force and dst_dir != '/' and not is_dir_exists(dst_dir[:-1]) and len(locate_file(dst_dir)) == 0: try: cephfs.mkdirs(to_bytes(dst_dir), 0o777) @@ -587,7 +587,7 @@ exists.') for file_ in files: src_file = os.path.join(src_dir, file_) - dst_file = re.sub('\/+', '/', '/' + dst_dir + '/' + file_) + dst_file = re.sub(r'\/+', '/', '/' + dst_dir + '/' + file_) if (not args.force) and is_file_exists(dst_file): return copy_from_local(src_file, os.path.join(