Zhentan exitcode (#1049)
* Remove raise exception to allow wait() to run that include exit code in exception * Exit the system with correct exit code * Fix external_tool indentation * Style fixing * remove import to fix style issues * Fix pylint version at 2.5 to avoid merge issues on style check * Updated files to pass style check
This commit is contained in:
Родитель
335bdb0624
Коммит
37188cd59a
|
@ -7,7 +7,6 @@ import json
|
|||
import os
|
||||
|
||||
from knack.log import get_logger
|
||||
from knack.util import CLIError
|
||||
|
||||
from azext_devops.dev.common.services import _get_credentials
|
||||
from azext_devops.dev.common.const import ARTIFACTTOOL_PAT_ENVKEY
|
||||
|
@ -100,7 +99,7 @@ def _log_message(json_line):
|
|||
ex = json_line['@x'] if '@x' in json_line else None
|
||||
if ex:
|
||||
message = "{}\n{}".format(message, ex)
|
||||
raise CLIError(message)
|
||||
logger.error(message)
|
||||
if log_level == "Warning":
|
||||
logger.warning(message)
|
||||
elif log_level == "Information":
|
||||
|
|
|
@ -7,6 +7,7 @@ import os
|
|||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
import humanfriendly
|
||||
from knack.log import get_logger
|
||||
|
@ -48,8 +49,14 @@ class ExternalToolInvoker:
|
|||
stderr = self._proc.stderr.read().decode('utf-8', 'ignore').strip()
|
||||
if stderr != "":
|
||||
stderr = "\n{}".format(stderr)
|
||||
raise CLIError("Process {proc} with PID {pid} exited with return code {code}{err}"
|
||||
.format(proc=self._args, pid=self._proc.pid, code=self._proc.returncode, err=stderr))
|
||||
try:
|
||||
raise CLIError(
|
||||
"Process {proc} with PID {pid} exited with return code {code}{err}"
|
||||
.format(proc=self._args, pid=self._proc.pid, code=self._proc.returncode, err=stderr)
|
||||
)
|
||||
except CLIError:
|
||||
traceback.print_exc()
|
||||
sys.exit(self._proc.returncode)
|
||||
return self._proc
|
||||
|
||||
def _sigint_handler(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$failure = $false
|
||||
|
||||
Write-Output "Installing pylint"
|
||||
pip install pylint
|
||||
pip install pylint==2.5
|
||||
|
||||
Write-Output "Installing flake8"
|
||||
pip install flake8
|
||||
|
|
Загрузка…
Ссылка в новой задаче