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: v15.1.0~448^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d4f4a2cbd81f2c86e281b9220bd5b727c0fd85f3;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 --- diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 6d8bebeb07d0..ebdfded63694 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -58,13 +58,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)