mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Correctly spli command line as shell.
This commit is contained in:
+2
-1
@@ -7,6 +7,7 @@ import inspect
|
|||||||
import json
|
import json
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
|
import shlex
|
||||||
import shutil
|
import shutil
|
||||||
import string
|
import string
|
||||||
|
|
||||||
@@ -79,7 +80,7 @@ class BaseTest(object):
|
|||||||
|
|
||||||
def run_cmd(self, command, expected_code=0):
|
def run_cmd(self, command, expected_code=0):
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen(command.split(" "), stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
|
proc = subprocess.Popen(shlex.split(command), stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
|
||||||
output, _ = proc.communicate()
|
output, _ = proc.communicate()
|
||||||
if proc.returncode != expected_code:
|
if proc.returncode != expected_code:
|
||||||
raise Exception("exit code %d != %d (output: %s)" % (proc.returncode, expected_code, output))
|
raise Exception("exit code %d != %d (output: %s)" % (proc.returncode, expected_code, output))
|
||||||
|
|||||||
Reference in New Issue
Block a user