提交 9a994007 编写于 作者: C Cleber Rosa

Plugins Dispatcher: introduce fully_qualified_name()

As done with `plugin_type()` let's also add an utility method
that gives the plugin's fully qualified name for a given extension.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 1f90a991
......@@ -51,10 +51,18 @@ class Dispatcher(EnabledExtensionManager):
else:
return self.namespace
def fully_qualified_name(self, extension):
"""
Returns the Avocado fully qualified plugin name
:param extension: an Stevedore Extension instance
:type extension: :class:`stevedore.extension.Extension`
"""
return "%s.%s" % (self.plugin_type(), extension.entry_point.name)
def enabled(self, extension):
disabled = settings.get_value('plugins', 'disable', key_type=list)
fqn = "%s.%s" % (self.plugin_type(), extension.entry_point.name)
return fqn not in disabled
return self.fully_qualified_name(extension) not in disabled
def names(self):
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册