summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/plugin.py')
-rw-r--r--scripts/lib/wic/plugin.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/scripts/lib/wic/plugin.py b/scripts/lib/wic/plugin.py
index 064243dc9d..c200822af7 100644
--- a/scripts/lib/wic/plugin.py
+++ b/scripts/lib/wic/plugin.py
@@ -109,22 +109,18 @@ class PluginMgr:
109 return pluginbase.get_plugins(ptype) 109 return pluginbase.get_plugins(ptype)
110 110
111 @classmethod 111 @classmethod
112 def get_source_plugin_methods(cls, source_name, methods): 112 def get_plugin_methods(cls, ptype, pname, methods):
113 """ 113 """
114 The methods param is a dict with the method names to find. On 114 The methods param is a dict with the method names to find. On
115 return, the dict values will be filled in with pointers to the 115 return, the dict values will be filled in with pointers to the
116 corresponding methods. If one or more methods are not found, 116 corresponding methods. If one or more methods are not found,
117 None is returned. 117 None is returned.
118 """ 118 """
119 return_methods = None 119 result = {}
120 for _source_name, klass in cls.get_plugins('source').items(): 120 plugin = cls.get_plugins(ptype).get(pname)
121 if _source_name == source_name: 121 for method in methods:
122 for _method_name in methods: 122 if not hasattr(plugin, method):
123 if not hasattr(klass, _method_name): 123 raise WicError("Unimplemented %s plugin interface for: %s" %
124 logger.warning("Unimplemented %s source interface for: %s", 124 (method, pname))
125 _method_name, _source_name) 125 result[method] = getattr(plugin, method)
126 return None 126 return result
127 func = getattr(klass, _method_name)
128 methods[_method_name] = func
129 return_methods = methods
130 return return_methods