mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 13:49:49 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
455ce228df
commit
59b72c0b26
@@ -21,6 +21,8 @@ import logging
|
|||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
|
from wic import WicError
|
||||||
|
|
||||||
logger = logging.getLogger('wic')
|
logger = logging.getLogger('wic')
|
||||||
|
|
||||||
class PluginMeta(type):
|
class PluginMeta(type):
|
||||||
@@ -35,6 +37,10 @@ class PluginMeta(type):
|
|||||||
class ImagerPlugin(metaclass=PluginMeta):
|
class ImagerPlugin(metaclass=PluginMeta):
|
||||||
wic_plugin_type = "imager"
|
wic_plugin_type = "imager"
|
||||||
|
|
||||||
|
def do_create(self):
|
||||||
|
raise WicError("Method %s.do_create is not implemented" %
|
||||||
|
self.__class__.__name__)
|
||||||
|
|
||||||
class SourcePlugin(metaclass=PluginMeta):
|
class SourcePlugin(metaclass=PluginMeta):
|
||||||
wic_plugin_type = "source"
|
wic_plugin_type = "source"
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user