From: dparmar18 Date: Thu, 26 May 2022 09:20:35 +0000 (+0530) Subject: qa/cephfs: fix read_debug_file() return value and a pep8 violation X-Git-Tag: v17.2.4~93^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F46899%2Fhead;p=ceph.git qa/cephfs: fix read_debug_file() return value and a pep8 violation Signed-off-by: Dhairya Parmar (cherry picked from commit 269567d005092edfd0573cd3fccc302cd96fc618) --- diff --git a/qa/tasks/cephfs/kernel_mount.py b/qa/tasks/cephfs/kernel_mount.py index c29dcdeb47bf..e43bb0ccbc73 100644 --- a/qa/tasks/cephfs/kernel_mount.py +++ b/qa/tasks/cephfs/kernel_mount.py @@ -213,12 +213,16 @@ class KernelMount(CephFSMount): stdout = StringIO() stderr = StringIO() try: - self.run_shell_payload(f"sudo dd if={path}", timeout=(5*60), - stdout=stdout, stderr=stderr) + self.run_shell_payload(f"sudo dd if={path}", timeout=(5 * 60), + stdout=stdout, stderr=stderr) return stdout.getvalue() except CommandFailedError: if 'no such file or directory' in stderr.getvalue().lower(): - return None + return errno.ENOENT + elif 'not a directory' in stderr.getvalue().lower(): + return errno.ENOTDIR + elif 'permission denied' in stderr.getvalue().lower(): + return errno.EACCES raise def _get_global_id(self):