]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: throw exception if required API is not implemented
authorEd Bartosh <ed.bartosh@linux.intel.com>
Wed, 15 Feb 2017 17:50:45 +0000 (19:50 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 4 Mar 2017 10:42:31 +0000 (10:42 +0000)
Throw WicError if do_create method of imager plugin is
not implemented.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
scripts/lib/wic/pluginbase.py

index 07ccf622f4c91cd560750a77556af9e0254d3ca1..743170a5fa06cd2e2272538096cbe2f8016df426 100644 (file)
@@ -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"
     """