check_status=check_status,
omit_sudo=omit_sudo)
+ def run_as_user(self, args, user, wait=True, stdin=None, check_status=True):
+ # FIXME maybe should add a pwd arg to teuthology.orchestra so that
+ # the "cd foo && bar" shenanigans isn't needed to begin with and
+ # then we wouldn't have to special case this
+ if isinstance(args, str):
+ args = 'sudo -u %s -s /bin/bash -c %s' % (user, args)
+ elif isinstance(args, list):
+ cmdlist = args
+ cmd = ''
+ for i in cmdlist:
+ cmd = cmd + i + ' '
+ args = ['sudo', '-u', user, '-s', '/bin/bash', '-c']
+ args.append(cmd)
+
+ return self.client_remote.run(args, wait=wait, cwd=self.mountpoint,
+ check_status=check_status, stdin=stdin,
+ omit_sudo=False)
+
def setupfs(self, name=None):
if name is None and self.fs is not None:
# Previous mount existed, reuse the old name