From 9da6bdf4bb426312ce6222208bba3aa37d06618b Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Mon, 12 Jul 2021 08:18:27 -0700 Subject: [PATCH] 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 --- qa/tasks/cephfs/cephfs_test_case.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/qa/tasks/cephfs/cephfs_test_case.py b/qa/tasks/cephfs/cephfs_test_case.py index 9ef7989d9468d..40af40625498f 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]) -- 2.39.5