本文整理汇总了Python中avocado.core.output.LOG_UI.warning方法的典型用法代码示例。如果您正苦于以下问题:Python LOG_UI.warning方法的具体用法?Python LOG_UI.warning怎么用?Python LOG_UI.warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类avocado.core.output.LOG_UI
的用法示例。
在下文中一共展示了LOG_UI.warning方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from avocado.core.output import LOG_UI [as 别名]
# 或者: from avocado.core.output.LOG_UI import warning [as 别名]
def run(self, args):
if getattr(args, 'replay_jobid', None) is None:
return
err = None
if args.replay_teststatus and 'variants' in args.replay_ignore:
err = ("Option `--replay-test-status` is incompatible with "
"`--replay-ignore variants`.")
elif args.replay_teststatus and args.reference:
err = ("Option --replay-test-status is incompatible with "
"test references given on the command line.")
elif getattr(args, "remote_hostname", False):
err = "Currently we don't replay jobs in remote hosts."
if err is not None:
LOG_UI.error(err)
sys.exit(exit_codes.AVOCADO_FAIL)
base_logdir = getattr(args, 'base_logdir', None)
if base_logdir is None:
base_logdir = settings.get_value(section='datadir.paths',
key='logs_dir', key_type='path',
default=None)
try:
resultsdir = jobdata.get_resultsdir(base_logdir, args.replay_jobid)
except ValueError as exception:
LOG_UI.error(exception.message)
sys.exit(exit_codes.AVOCADO_FAIL)
if resultsdir is None:
LOG_UI.error("Can't find job results directory in '%s'", base_logdir)
sys.exit(exit_codes.AVOCADO_FAIL)
sourcejob = jobdata.get_id(os.path.join(resultsdir, 'id'),
args.replay_jobid)
if sourcejob is None:
msg = ("Can't find matching job id '%s' in '%s' directory."
% (args.replay_jobid, resultsdir))
LOG_UI.error(msg)
sys.exit(exit_codes.AVOCADO_FAIL)
setattr(args, 'replay_sourcejob', sourcejob)
replay_args = jobdata.retrieve_args(resultsdir)
whitelist = ['loaders',
'external_runner',
'external_runner_testdir',
'external_runner_chdir',
'failfast',
'ignore_missing_references',
'execution_order']
if replay_args is None:
LOG_UI.warn('Source job args data not found. These options will '
'not be loaded in this replay job: %s',
', '.join(whitelist))
else:
for option in whitelist:
optvalue = getattr(args, option, None)
if optvalue is not None:
LOG_UI.warn("Overriding the replay %s with the --%s value "
"given on the command line.",
option.replace('_', '-'),
option.replace('_', '-'))
elif option in replay_args:
setattr(args, option, replay_args[option])
if getattr(args, 'reference', None):
LOG_UI.warn('Overriding the replay test references with test '
'references given in the command line.')
else:
references = jobdata.retrieve_references(resultsdir)
if references is None:
LOG_UI.error('Source job test references data not found. '
'Aborting.')
sys.exit(exit_codes.AVOCADO_FAIL)
else:
setattr(args, 'reference', references)
if 'config' in args.replay_ignore:
LOG_UI.warn("Ignoring configuration from source job with "
"--replay-ignore.")
else:
self.load_config(resultsdir)
if 'variants' in args.replay_ignore:
LOG_UI.warn("Ignoring variants from source job with "
"--replay-ignore.")
else:
variants = jobdata.retrieve_variants(resultsdir)
if variants is None:
LOG_UI.error('Source job variants data not found. Aborting.')
sys.exit(exit_codes.AVOCADO_FAIL)
else:
LOG_UI.warning("Using src job Mux data only, use "
"`--replay-ignore variants` to override "
"them.")
setattr(args, "avocado_variants", variants)
# Extend "replay_test_status" of "INTERRUPTED" when --replay-resume
# supplied.
if args.replay_resume:
if not args.replay_teststatus:
#.........这里部分代码省略.........
示例2: _log_deprecation_msg
# 需要导入模块: from avocado.core.output import LOG_UI [as 别名]
# 或者: from avocado.core.output.LOG_UI import warning [as 别名]
def _log_deprecation_msg(deprecated, current):
"""
Log a message into the avocado.LOG_UI warning log
"""
msg = "The use of '%s' is deprecated, please use '%s' instead"
LOG_UI.warning(msg, deprecated, current)
示例3: run
# 需要导入模块: from avocado.core.output import LOG_UI [as 别名]
# 或者: from avocado.core.output.LOG_UI import warning [as 别名]
def run(self, args):
LOG_UI.warning("The 'avocado multiplex' command is deprecated by the "
"'avocado variants' one. Please start using that one "
"instead as this will be removed in Avocado 52.0.")
super(Multiplex, self).run(args)