From: Sage Weil Date: Fri, 13 Dec 2019 18:42:57 +0000 (+0000) Subject: qa/tasks/ceph_manager.py: do not use python to write a file X-Git-Tag: v14.2.10~17^2~8 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1277971bd930efd3b6539de9f1b97a66aeff47e9;p=ceph.git qa/tasks/ceph_manager.py: do not use python to write a file /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 (cherry picked from commit d4f4a2cbd81f2c86e281b9220bd5b727c0fd85f3) --- diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 211a46fec114d..130182f25dab5 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -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)