From: Patrick Donnelly Date: Mon, 12 Jul 2021 15:18:27 +0000 (-0700) Subject: pacific: qa: avoid sudo on tmpfile X-Git-Tag: v16.2.6~136^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9da6bdf4bb426312ce6222208bba3aa37d06618b;p=ceph.git pacific: qa: avoid sudo on tmpfile This code does not exist in master. This is a continuation of the fix for the backport. Resolves failures like [1]. [1] /ceph/teuthology-archive/yuriw-2021-07-08_23:33:26-fs-wip-yuri2-testing-2021-07-08-1142-pacific-distro-basic-smithi/6260232/teuthology.log Fixes: https://tracker.ceph.com/issues/51704 Signed-off-by: Patrick Donnelly --- diff --git a/qa/tasks/cephfs/cephfs_test_case.py b/qa/tasks/cephfs/cephfs_test_case.py index 9ef7989d9468..40af40625498 100644 --- a/qa/tasks/cephfs/cephfs_test_case.py +++ b/qa/tasks/cephfs/cephfs_test_case.py @@ -4,12 +4,10 @@ import os import re from shlex import split as shlex_split -from io import StringIO from tasks.ceph_test_case import CephTestCase from teuthology import contextutil -from teuthology.misc import sudo_write_file from teuthology.orchestra import run from teuthology.orchestra.run import CommandFailedError @@ -445,9 +443,7 @@ class CephFSTestCase(CephTestCase): return self.run_cluster_cmd(f'auth get {self.client_name}') def create_keyring_file(self, remote, keyring): - keyring_path = remote.run(args=['mktemp'], stdout=StringIO()).\ - stdout.getvalue().strip() - sudo_write_file(remote, keyring_path, keyring) + keyring_path = remote.mktemp(data=keyring) # required when triggered using vstart_runner.py. remote.run(args=['chmod', '644', keyring_path])