From: Rishabh Dave Date: Thu, 20 Jun 2019 16:05:38 +0000 (+0530) Subject: vstart_runner: upgrade the check for commands to be run as another user X-Git-Tag: v15.1.0~2402^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F28561%2Fhead;p=ceph.git vstart_runner: upgrade the check for commands to be run as another user Rectify the condition that checks if command to be issued as another user using sudo is issued as a single argument after "-c". Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index e3589c912e43..99c63a7c7b18 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -264,8 +264,8 @@ class LocalRemote(object): # the desired effect. errmsg = 'The entire command to executed as other user should be a ' +\ 'single argument.\nargs - %s' % (args) - if ('sudo' in args or 'python' in args or 'python2' in args or - 'python3' in args) and '-c' in args: + if 'sudo' in args and '-u' in args and '-c' in args and \ + args.count('-c') == 1: if args.index('-c') != len(args) - 2 and \ args[args.index('-c') + 2].find('-') == -1: raise RuntimeError(errmsg)