[gnome-continuous-yocto/gnomeostree-3.28-rocko: 4921/8267] wic: throw exception if required API is not implemented



commit 59b72c0b260001b98eca87f3e6c0dfccef38182c
Author: Ed Bartosh <ed bartosh linux intel com>
Date:   Wed Feb 15 19:50:45 2017 +0200

    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>

 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 07ccf62..743170a 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"
     """


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]