diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-02-15 19:50:45 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-04 23:18:17 +0000 |
commit | 59b72c0b260001b98eca87f3e6c0dfccef38182c (patch) | |
tree | df11d049e83d9526a2888819fced9f27577a7f93 /scripts | |
parent | 455ce228df18eb67ba08b7433eea334df6994391 (diff) | |
download | poky-59b72c0b260001b98eca87f3e6c0dfccef38182c.tar.gz |
wic: throw exception if required API is not implemented
Throw WicError if do_create method of imager plugin is
not implemented.
(From OE-Core rev: 87031c933047a37ddc26be3d04ea17b6e60ea10a)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/wic/pluginbase.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/lib/wic/pluginbase.py b/scripts/lib/wic/pluginbase.py index 07ccf622f4..743170a5fa 100644 --- a/scripts/lib/wic/pluginbase.py +++ b/scripts/lib/wic/pluginbase.py | |||
@@ -21,6 +21,8 @@ import logging | |||
21 | 21 | ||
22 | from collections import defaultdict | 22 | from collections import defaultdict |
23 | 23 | ||
24 | from wic import WicError | ||
25 | |||
24 | logger = logging.getLogger('wic') | 26 | logger = logging.getLogger('wic') |
25 | 27 | ||
26 | class PluginMeta(type): | 28 | class PluginMeta(type): |
@@ -35,6 +37,10 @@ class PluginMeta(type): | |||
35 | class ImagerPlugin(metaclass=PluginMeta): | 37 | class ImagerPlugin(metaclass=PluginMeta): |
36 | wic_plugin_type = "imager" | 38 | wic_plugin_type = "imager" |
37 | 39 | ||
40 | def do_create(self): | ||
41 | raise WicError("Method %s.do_create is not implemented" % | ||
42 | self.__class__.__name__) | ||
43 | |||
38 | class SourcePlugin(metaclass=PluginMeta): | 44 | class SourcePlugin(metaclass=PluginMeta): |
39 | wic_plugin_type = "source" | 45 | wic_plugin_type = "source" |
40 | """ | 46 | """ |