|
|
@ -9,7 +9,6 @@ import fcntl
|
|
|
|
import inspect
|
|
|
|
import inspect
|
|
|
|
import json
|
|
|
|
import json
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import pipes
|
|
|
|
|
|
|
|
import pkgutil
|
|
|
|
import pkgutil
|
|
|
|
import random
|
|
|
|
import random
|
|
|
|
import re
|
|
|
|
import re
|
|
|
@ -38,6 +37,11 @@ except ImportError:
|
|
|
|
# noinspection PyCompatibility
|
|
|
|
# noinspection PyCompatibility
|
|
|
|
from configparser import ConfigParser
|
|
|
|
from configparser import ConfigParser
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
from shlex import quote as cmd_quote
|
|
|
|
|
|
|
|
except ImportError:
|
|
|
|
|
|
|
|
from pipes import quote as cmd_quote
|
|
|
|
|
|
|
|
|
|
|
|
DOCKER_COMPLETION = {} # type: dict[str, dict[str, str]]
|
|
|
|
DOCKER_COMPLETION = {} # type: dict[str, dict[str, str]]
|
|
|
|
REMOTE_COMPLETION = {} # type: dict[str, dict[str, str]]
|
|
|
|
REMOTE_COMPLETION = {} # type: dict[str, dict[str, str]]
|
|
|
|
PYTHON_PATHS = {} # type: dict[str, str]
|
|
|
|
PYTHON_PATHS = {} # type: dict[str, str]
|
|
|
@ -389,7 +393,7 @@ def raw_command(cmd, capture=False, env=None, data=None, cwd=None, explain=False
|
|
|
|
|
|
|
|
|
|
|
|
cmd = list(cmd)
|
|
|
|
cmd = list(cmd)
|
|
|
|
|
|
|
|
|
|
|
|
escaped_cmd = ' '.join(pipes.quote(c) for c in cmd)
|
|
|
|
escaped_cmd = ' '.join(cmd_quote(c) for c in cmd)
|
|
|
|
|
|
|
|
|
|
|
|
display.info('Run command: %s' % escaped_cmd, verbosity=cmd_verbosity, truncate=True)
|
|
|
|
display.info('Run command: %s' % escaped_cmd, verbosity=cmd_verbosity, truncate=True)
|
|
|
|
display.info('Working directory: %s' % cwd, verbosity=2)
|
|
|
|
display.info('Working directory: %s' % cwd, verbosity=2)
|
|
|
@ -763,7 +767,7 @@ class SubprocessError(ApplicationError):
|
|
|
|
:type stderr: str | None
|
|
|
|
:type stderr: str | None
|
|
|
|
:type runtime: float | None
|
|
|
|
:type runtime: float | None
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
message = 'Command "%s" returned exit status %s.\n' % (' '.join(pipes.quote(c) for c in cmd), status)
|
|
|
|
message = 'Command "%s" returned exit status %s.\n' % (' '.join(cmd_quote(c) for c in cmd), status)
|
|
|
|
|
|
|
|
|
|
|
|
if stderr:
|
|
|
|
if stderr:
|
|
|
|
message += '>>> Standard Error\n'
|
|
|
|
message += '>>> Standard Error\n'
|
|
|
|