提交 305d390b 编写于 作者: L Lukáš Doktor

avocado.tree: Allow combining of debug and non-debug TreeNodes

The TreeNodeDebug needs the origin to work properly. This patch allows
combyining debug and non-debug trees by supplying "Unknown" origin when
to non-debug TreeNodes.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 c715c885
......@@ -12,7 +12,6 @@
# Copyright: Red Hat Inc. 2013-2014
# Author: Lucas Meneghel Rodrigues <lmr@redhat.com>
import os
import sys
from avocado.core.plugins import plugin
......@@ -91,7 +90,10 @@ class Multiplexer(plugin.Plugin):
else:
color = output.term_support.LOWLIGHT
cend = output.term_support.ENDC
paths = ', '.join(["%s%s@%s%s" % (_.name, color, _.yaml, cend)
paths = ', '.join(["%s%s@%s%s" % (_.name, color,
getattr(_, 'yaml',
"Unknown"),
cend)
for _ in tpl])
view.notify(event='minor', msg='%sVariant %s: %s' %
(('\n' if args.contents else ''), index + 1, paths))
......
......@@ -670,7 +670,7 @@ class TreeNodeDebug(TreeNode): # only container pylint: disable=R0903
Override origin with the one from other tree. Updated/Newly set values
are going to use this location as origin.
"""
if hasattr(other, 'yaml'):
if hasattr(other, 'yaml') and other.yaml:
srcyaml = os.path.relpath(other.yaml)
# when we use TreeNodeDebug, value is always ValueDict
self.value.yaml_per_key.update(other.value.yaml_per_key) # pylint: disable=E1101
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册