]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/ceph_manager.py: do not use python to write a file
authorSage Weil <sage@redhat.com>
Fri, 13 Dec 2019 18:42:57 +0000 (18:42 +0000)
committerKefu Chai <kchai@redhat.com>
Wed, 3 Jun 2020 11:57:01 +0000 (19:57 +0800)
/usr/bin/python dne on el8, /usr/bin/python3 dne on el7.  But
all we need to do is write a file--we can do that with tee.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit d4f4a2cbd81f2c86e281b9220bd5b727c0fd85f3)

qa/tasks/ceph_manager.py

index 211a46fec114d5e40004828c78b2b491d46454dc..130182f25dab5216d0a7cfd1105a45f2e35bf87f 100644 (file)
@@ -44,13 +44,10 @@ def write_conf(ctx, conf_path=DEFAULT_CONF_PATH, cluster='ceph'):
         args=[
             'sudo', 'mkdir', '-p', '/etc/ceph', run.Raw('&&'),
             'sudo', 'chmod', '0755', '/etc/ceph', run.Raw('&&'),
-            'sudo', 'python',
-            '-c',
-            ('import shutil, sys; '
-             'shutil.copyfileobj(sys.stdin, file(sys.argv[1], "wb"))'),
-            conf_path,
-            run.Raw('&&'),
+            'sudo', 'tee', conf_path, run.Raw('&&'),
             'sudo', 'chmod', '0644', conf_path,
+            run.Raw('>'), '/dev/null',
+
         ],
         stdin=run.PIPE,
         wait=False)