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

avocado.core.app: Improve compatibility with older stevedore

Older versions of stevedore does not support `__contains__` method. Use
try/except to handle subcommand handling.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 c58d42ed
......@@ -68,8 +68,9 @@ class AvocadoApp(object):
view.notify(event='error', msg=msg)
def run(self):
subcommand = self.parser.args.subcommand
if subcommand in self.cli_cmd_dispatcher:
extension = self.cli_cmd_dispatcher[subcommand]
method = extension.obj.run
return method(self.parser.args)
try:
extension = self.cli_cmd_dispatcher[self.parser.args.subcommand]
except KeyError:
return
method = extension.obj.run
return method(self.parser.args)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册