未验证 提交 ff15c105 编写于 作者: R Rudá Moura

avocado.plugins: Use constants from avocado.core.exit_codes.

Using exit constants from avocado.core.exit_codes.
Signed-off-by: NRudá Moura <rmoura@redhat.com>
上级 3c66e726
......@@ -23,7 +23,7 @@ import webbrowser
import pystache
from avocado.core import error_codes
from avocado.core import exit_codes
from avocado.core import output
from avocado.plugins import plugin
from avocado.result import TestResult
......@@ -215,7 +215,7 @@ class HTMLTestResult(TestResult):
if self.output == '-':
self.view.notify(event='error', msg="HTML to stdout not supported "
"(not all HTML resources can be embedded to a single file)")
sys.exit(error_codes.numeric_status['AVOCADO_JOB_FAIL'])
sys.exit(exit_codes.AVOCADO_JOB_FAIL)
else:
output_dir = os.path.dirname(os.path.abspath(self.output))
if not os.path.exists(output_dir):
......
......@@ -18,7 +18,7 @@ import collections
from avocado.plugins import plugin
from avocado.core import output
from avocado.core import error_codes
from avocado.core import exit_codes
from avocado.core import tree
from avocado import multiplexer
......@@ -60,14 +60,14 @@ class Multiplexer(plugin.Plugin):
if not os.path.isfile(path):
view.notify(event='error',
msg='Invalid multiplex file %s' % path)
sys.exit(error_codes.numeric_status['AVOCADO_JOB_FAIL'])
sys.exit(exit_codes.AVOCADO_JOB_FAIL)
if args.tree:
view.notify(event='message', msg='Config file tree structure:')
t = tree.create_from_yaml(multiplex_files)
t = tree.apply_filters(t, args.filter_only, args.filter_out)
view.notify(event='minor', msg=t.get_ascii())
sys.exit(error_codes.numeric_status['AVOCADO_ALL_OK'])
sys.exit(exit_codes.AVOCADO_ALL_OK)
variants = multiplexer.multiplex_yamls(multiplex_files,
args.filter_only,
......@@ -85,4 +85,4 @@ class Multiplexer(plugin.Plugin):
for k in sorted(env.keys()):
view.notify(event='minor', msg=' %s: %s' % (k, env[k]))
sys.exit(error_codes.numeric_status['AVOCADO_ALL_OK'])
sys.exit(exit_codes.AVOCADO_ALL_OK)
......@@ -18,7 +18,7 @@ Base Test Runner Plugins.
import sys
from avocado.core import error_codes
from avocado.core import exit_codes
from avocado.plugins import plugin
from avocado.core import output
from avocado import job
......@@ -122,7 +122,7 @@ class TestRunner(plugin.Plugin):
raise ValueError
except ValueError:
view.notify(event='error', msg='Unique Job ID needs to be a 40 digit hex number')
return sys.exit(error_codes.numeric_status['AVOCADO_CRASH'])
return sys.exit(exit_codes.AVOCADO_CRASH)
job_instance = job.Job(args)
rc = job_instance.run()
......
......@@ -16,7 +16,7 @@ import os
import sys
from avocado import runtime
from avocado.core import error_codes
from avocado.core import exit_codes
from avocado.core import output
from avocado.plugins import plugin
......@@ -46,7 +46,7 @@ class Wrapper(plugin.Plugin):
view.notify(event='error',
msg="You can't have multiple global"
" wrappers at once.")
sys.exit(error_codes.numeric_status['AVOCADO_CRASH'])
sys.exit(exit_codes.AVOCADO_CRASH)
else:
script, cmd = wrap.split(':', 1)
script = os.path.abspath(script)
......@@ -54,11 +54,11 @@ class Wrapper(plugin.Plugin):
if not os.path.exists(script):
view.notify(event='error',
msg="Wrapper '%s' not found!" % script)
sys.exit(error_codes.numeric_status['AVOCADO_CRASH'])
sys.exit(exit_codes.AVOCADO_CRASH)
if app_args.gdb_run_bin:
view.notify(event='error',
msg='Command line option --wrapper is incompatible'
' with option --gdb-run-bin.')
sys.exit(error_codes.numeric_status['AVOCADO_CRASH'])
sys.exit(exit_codes.AVOCADO_CRASH)
except AttributeError:
pass
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册