]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: fix read_debug_file() return value and a pep8 violation 46899/head
authordparmar18 <dparmar@redhat.com>
Thu, 26 May 2022 09:20:35 +0000 (14:50 +0530)
committerdparmar18 <dparmar@redhat.com>
Thu, 18 Aug 2022 10:18:29 +0000 (15:48 +0530)
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
(cherry picked from commit 269567d005092edfd0573cd3fccc302cd96fc618)

qa/tasks/cephfs/kernel_mount.py

index c29dcdeb47bf8ea5a8035c3a4dbaddd000f42bda..e43bb0ccbc7362a71c44502b6581b7fbf69b0a7a 100644 (file)
@@ -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):