From: Rishabh Dave Date: Wed, 7 Aug 2019 09:48:19 +0000 (+0530) Subject: orchestra/remote: add a method to create temporary directory X-Git-Tag: 1.1.0~236^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1301%2Fhead;p=teuthology.git orchestra/remote: add a method to create temporary directory Signed-off-by: Rishabh Dave --- diff --git a/teuthology/orchestra/remote.py b/teuthology/orchestra/remote.py index db8317b99..9ca1c9e1b 100644 --- a/teuthology/orchestra/remote.py +++ b/teuthology/orchestra/remote.py @@ -206,6 +206,19 @@ class Remote(object): r.remote = self return r + def mkdtemp(self, suffix=None, parentdir=None): + """ + Create a temporary directory on remote machine and return it's path. + """ + args = ['mktemp', '-d'] + + if suffix: + args.append('--suffix=%s' % suffix) + if parentdir: + args.append('--tmpdir=%s' % parentdir) + + return self.sh(args).strip() + def mktemp(self): """ Make a remote temporary file