Patchwork [18/35] wic: Remove unused plugin and error code

login
register
mail settings
Submitter tom.zanussi@linux.intel.com
Date Aug. 8, 2014, 10:05 p.m.
Message ID <8a8bd16104d4ce6f51253c615485057af4250187.1407533201.git.tom.zanussi@linux.intel.com>
Download mbox | patch
Permalink /patch/77597/
State Accepted
Commit df42125f2c2065e13d96ef9cfb21bb4a59c90ec3
Headers show

Comments

tom.zanussi@linux.intel.com - Aug. 8, 2014, 10:05 p.m.
wic doesn't use it, so remove it.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/lib/mic/plugin.py                  |  2 +-
 scripts/lib/mic/pluginbase.py              | 45 ++----------------------------
 scripts/lib/mic/plugins/hook/.py           |  0
 scripts/lib/mic/plugins/hook/empty_hook.py |  3 --
 scripts/lib/mic/utils/errors.py            | 21 --------------
 5 files changed, 3 insertions(+), 68 deletions(-)
 delete mode 100644 scripts/lib/mic/plugins/hook/.py
 delete mode 100644 scripts/lib/mic/plugins/hook/empty_hook.py

Patch

diff --git a/scripts/lib/mic/plugin.py b/scripts/lib/mic/plugin.py
index f836950..43afdbc 100644
--- a/scripts/lib/mic/plugin.py
+++ b/scripts/lib/mic/plugin.py
@@ -24,7 +24,7 @@  from mic.utils.oe.misc import *
 
 __ALL__ = ['PluginMgr', 'pluginmgr']
 
-PLUGIN_TYPES = ["imager", "source"] # TODO  "hook"
+PLUGIN_TYPES = ["imager", "source"]
 
 PLUGIN_DIR = "/lib/mic/plugins" # relative to scripts
 SCRIPTS_PLUGIN_DIR = "scripts" + PLUGIN_DIR
diff --git a/scripts/lib/mic/pluginbase.py b/scripts/lib/mic/pluginbase.py
index 9cf4c62..46a4f4a 100644
--- a/scripts/lib/mic/pluginbase.py
+++ b/scripts/lib/mic/pluginbase.py
@@ -40,45 +40,10 @@  class _Plugin(object):
         def get_plugins(cls):
             return cls.plugins
 
+
 class ImagerPlugin(_Plugin):
     mic_plugin_type = "imager"
 
-    @classmethod
-    def check_image_exists(self, destdir, apacking=None,
-                                          images=(),
-                                          release=None):
-
-        # if it's a packing file, reset images
-        if apacking:
-            images = [apacking]
-
-        # release option will override images
-        if release is not None:
-            images = [os.path.basename(destdir.rstrip('/'))]
-            destdir = os.path.dirname(destdir.rstrip('/'))
-
-        for name in images:
-            if not name:
-                continue
-
-            image = os.path.join(destdir, name)
-            if not os.path.exists(image):
-                continue
-
-            if msger.ask("Target image/dir: %s already exists, "
-                         "clean up and continue?" % image):
-                if os.path.isdir(image):
-                    shutil.rmtree(image)
-                else:
-                    os.unlink(image)
-            else:
-                raise errors.Abort("Cancled")
-
-    def do_create(self):
-        pass
-
-    def do_chroot(self):
-        pass
 
 class SourcePlugin(_Plugin):
     mic_plugin_type = "source"
@@ -133,12 +98,6 @@  class SourcePlugin(_Plugin):
         """
         msger.debug("SourcePlugin: do_prepare_partition: part: %s" % part)
 
-class BackendPlugin(_Plugin):
-    mic_plugin_type="backend"
-
-    def addRepository(self):
-        pass
-
 def get_plugins(typen):
     ps = ImagerPlugin.get_plugins()
     if typen in ps:
@@ -146,4 +105,4 @@  def get_plugins(typen):
     else:
         return None
 
-__all__ = ['ImagerPlugin', 'BackendPlugin', 'SourcePlugin', 'get_plugins']
+__all__ = ['ImagerPlugin', 'SourcePlugin', 'get_plugins']
diff --git a/scripts/lib/mic/plugins/hook/.py b/scripts/lib/mic/plugins/hook/.py
deleted file mode 100644
index e69de29..0000000
diff --git a/scripts/lib/mic/plugins/hook/empty_hook.py b/scripts/lib/mic/plugins/hook/empty_hook.py
deleted file mode 100644
index 397585d..0000000
--- a/scripts/lib/mic/plugins/hook/empty_hook.py
+++ /dev/null
@@ -1,3 +0,0 @@ 
-#!/usr/bin/python
-
-# TODO: plugin base for hooks
diff --git a/scripts/lib/mic/utils/errors.py b/scripts/lib/mic/utils/errors.py
index 8d720f9..38fda30 100644
--- a/scripts/lib/mic/utils/errors.py
+++ b/scripts/lib/mic/utils/errors.py
@@ -43,29 +43,8 @@  class Usage(CreatorError):
 class Abort(CreatorError):
     keyword = ''
 
-class ConfigError(CreatorError):
-    keyword = '<config>'
-
 class KsError(CreatorError):
     keyword = '<kickstart>'
 
-class RepoError(CreatorError):
-    keyword = '<repo>'
-
-class RpmError(CreatorError):
-    keyword = '<rpm>'
-
 class MountError(CreatorError):
     keyword = '<mount>'
-
-class SnapshotError(CreatorError):
-    keyword = '<snapshot>'
-
-class SquashfsError(CreatorError):
-    keyword = '<squashfs>'
-
-class BootstrapError(CreatorError):
-    keyword = '<bootstrap>'
-
-class RuntimeError(CreatorError):
-    keyword = '<runtime>'