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

avocado.plugins.exec_path: Support for in-tree execution

In tree execution worked fine in virtual environment, but not without
it. This commit tries to iterate through PATH and detect the in-tree
libexec path.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 b5b2a9f4
......@@ -58,7 +58,16 @@ class ExecPath(plugin.Plugin):
elif os.path.exists('/usr/lib/avocado'):
self.view.notify(event='minor', msg='/usr/lib/avocado')
else:
self.view.notify(event='error',
msg="Can't locate avocado libexec path")
sys.exit(exit_codes.AVOCADO_FAIL)
for path in os.environ.get('PATH').split(':'):
if (os.path.exists(os.path.join(path, 'avocado')) and
os.path.exists(os.path.join(os.path.dirname(path),
'libexec'))):
self.view.notify(event='minor',
msg=os.path.join(os.path.dirname(path),
'libexec'))
break
else:
self.view.notify(event='error',
msg="Can't locate avocado libexec path")
sys.exit(exit_codes.AVOCADO_FAIL)
return sys.exit(exit_codes.AVOCADO_ALL_OK)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册