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

utils.vmimage: Use set to store providers

The IMAGE_PROVIDERS stores possible classes to provide images, let's
avoid unnecessary multiple occurrences.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 2ccc9647
......@@ -351,10 +351,10 @@ def list_providers():
"""
List the available Image Providers
"""
return [_ for _ in globals().itervalues()
if (_ != ImageProviderBase and
isinstance(_, type) and
issubclass(_, ImageProviderBase))]
return set(_ for _ in globals().itervalues()
if (_ != ImageProviderBase and
isinstance(_, type) and
issubclass(_, ImageProviderBase)))
#: List of available providers classes
......
......@@ -97,7 +97,7 @@ with::
class MyTest(Test):
def setUp(self):
vmimage.IMAGE_PROVIDERS.append(MyProvider)
vmimage.IMAGE_PROVIDERS.add(MyProvider)
image = vmimage.get('MyDistro')
...
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册