]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/cephfs: don't strip any whitespace for get_shell_stdout
authorRishabh Dave <ridave@redhat.com>
Fri, 12 Jan 2024 10:28:41 +0000 (15:58 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 25 Sep 2025 03:13:05 +0000 (08:43 +0530)
Whitespace is not removed from the end of the stdout returned by the
method get_ceph_cmd_stdout(). Follow the same policy here since it is
better to not do so (this whitespace can be useful, when copying Ceph
auth keyrings from stdout to a file) and also for sake of uniformity of
interfaces.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 9582b9b13a42fae4c7f38c22f9202eb893b6f1bc)

Conflicts:
qa/tasks/cephfs/mount.py
- Conflict occured for 2 reasons -
  - One, method get_shell_stdout() is absent on Reef branch but not in
    main so this patch which makes modification to it will obviously run
    in to conflict
   - Two, run_shell_payload() lies right next to get_shell_stdout() in
     main branch and its definition is quite different, leading to
     conflict again.

qa/tasks/cephfs/mount.py

index 6c4b0a8ca2b152bc3a355ceae39455b257f39c13..b418f88140f13423fa088b74f6234f6899758879 100644 (file)
@@ -782,6 +782,10 @@ class CephFSMount(object):
                                       stdout=stdout, stderr=stderr,
                                       omit_sudo=omit_sudo, **kwargs)
 
+    def get_shell_stdout(self, args, timeout=300, **kwargs):
+        return self.run_shell(args=args, timeout=timeout, **kwargs).stdout.\
+            getvalue()
+
     def run_shell_payload(self, payload, **kwargs):
         kwargs['args'] = ["bash", "-c", Raw(f"'{payload}'")]
         if kwargs.pop('sudo', False):