Add key -n for sudo utility
If user didn't configure sudo to work without password,
it'll prompt for password during the test if debug is
enabled in tempest confgiuration.
If a password is required for the command to run,
sudo with option -n will display an error messages and exit.
Change-Id: If7cdb331b3305c39a8f58746129ec2f125e651be
diff --git a/tempest/common/commands.py b/tempest/common/commands.py
index af7a692..6405eaa 100644
--- a/tempest/common/commands.py
+++ b/tempest/common/commands.py
@@ -29,7 +29,8 @@
subprocess_args = {'stdout': subprocess.PIPE,
'stderr': subprocess.STDOUT}
try:
- proc = subprocess.Popen(['/usr/bin/sudo'] + args, **subprocess_args)
+ proc = subprocess.Popen(['/usr/bin/sudo', '-n'] + args,
+ **subprocess_args)
return proc.communicate()[0]
if proc.returncode != 0:
LOG.error(cmd + "returned with: " +