From: Rachanaben Patel Date: Fri, 22 Nov 2019 05:06:32 +0000 (-0800) Subject: [qa] fixing 'python -c' in tasks so it works for python 2 and python 3 both X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F31803%2Fhead;p=ceph.git [qa] fixing 'python -c' in tasks so it works for python 2 and python 3 both Signed-off-by: Rachanaben Patel --- diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index f4cbbf6e08d2d..2341e1a44e609 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -41,11 +41,7 @@ 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, + "sudo", "sh", "-c", "cat > %s" % conf_path, run.Raw('&&'), 'sudo', 'chmod', '0644', conf_path, ],