summaryrefslogtreecommitdiff
path: root/scripts/lib
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-02-15 19:50:45 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-04 10:42:31 +0000
commit87031c933047a37ddc26be3d04ea17b6e60ea10a (patch)
treeeddfdc187e18ea382dc411397802d16ee61d0b1d /scripts/lib
parent808451f154867caef73e00af04f56f051b7d5f6b (diff)
downloadopenembedded-core-87031c933047a37ddc26be3d04ea17b6e60ea10a.tar.gz
openembedded-core-87031c933047a37ddc26be3d04ea17b6e60ea10a.tar.bz2
openembedded-core-87031c933047a37ddc26be3d04ea17b6e60ea10a.zip
wic: throw exception if required API is not implemented
Throw WicError if do_create method of imager plugin is not implemented. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/pluginbase.py6
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
from collections import defaultdict
+from wic import WicError
+
logger = logging.getLogger('wic')
class PluginMeta(type):
@@ -35,6 +37,10 @@ class PluginMeta(type):
class ImagerPlugin(metaclass=PluginMeta):
wic_plugin_type = "imager"
+ def do_create(self):
+ raise WicError("Method %s.do_create is not implemented" %
+ self.__class__.__name__)
+
class SourcePlugin(metaclass=PluginMeta):
wic_plugin_type = "source"
"""