From 36fd0df96cc014e3e107061114279b765606ff1a Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Tue, 2 Dec 2014 19:21:16 -0800 Subject: [PATCH] misc.create_file: if sudo, must sudo for chmod as well. Fixes: #10238 Signed-off-by: Dan Mick --- teuthology/misc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index 52d850e1f0..cec26e9ba3 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -650,7 +650,11 @@ def create_file(remote, path, data="", permissions=str(644), sudo=False): args.extend([ 'touch', path, - run.Raw('&&'), + run.Raw('&&') + ]) + if sudo: + args.append('sudo') + args.extend([ 'chmod', permissions, '--', -- 2.39.5