summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2014-08-04 14:27:52 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-11 10:53:10 +0100
commitdf42125f2c2065e13d96ef9cfb21bb4a59c90ec3 (patch)
tree6d992a3b436b60b4ac5c665606efc4fc108ac203 /scripts/lib
parent946dbec4ebde9a875dfc1213e8449cf11c92fbab (diff)
downloadpoky-df42125f2c2065e13d96ef9cfb21bb4a59c90ec3.tar.gz
wic: Remove unused plugin and error code
wic doesn't use it, so remove it. (From OE-Core rev: b818e5a1ed047940fda533da73fc50a099e1aa3f) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/mic/plugin.py2
-rw-r--r--scripts/lib/mic/pluginbase.py45
-rw-r--r--scripts/lib/mic/plugins/hook/.py0
-rw-r--r--scripts/lib/mic/plugins/hook/empty_hook.py3
-rw-r--r--scripts/lib/mic/utils/errors.py21
5 files changed, 3 insertions, 68 deletions
diff --git a/scripts/lib/mic/plugin.py b/scripts/lib/mic/plugin.py
index f836950727..43afdbc2f2 100644
--- a/scripts/lib/mic/plugin.py
+++ b/scripts/lib/mic/plugin.py
@@ -24,7 +24,7 @@ from mic.utils.oe.misc import *
24 24
25__ALL__ = ['PluginMgr', 'pluginmgr'] 25__ALL__ = ['PluginMgr', 'pluginmgr']
26 26
27PLUGIN_TYPES = ["imager", "source"] # TODO "hook" 27PLUGIN_TYPES = ["imager", "source"]
28 28
29PLUGIN_DIR = "/lib/mic/plugins" # relative to scripts 29PLUGIN_DIR = "/lib/mic/plugins" # relative to scripts
30SCRIPTS_PLUGIN_DIR = "scripts" + PLUGIN_DIR 30SCRIPTS_PLUGIN_DIR = "scripts" + PLUGIN_DIR
diff --git a/scripts/lib/mic/pluginbase.py b/scripts/lib/mic/pluginbase.py
index 9cf4c628d1..46a4f4a6b6 100644
--- a/scripts/lib/mic/pluginbase.py
+++ b/scripts/lib/mic/pluginbase.py
@@ -40,45 +40,10 @@ class _Plugin(object):
40 def get_plugins(cls): 40 def get_plugins(cls):
41 return cls.plugins 41 return cls.plugins
42 42
43
43class ImagerPlugin(_Plugin): 44class ImagerPlugin(_Plugin):
44 mic_plugin_type = "imager" 45 mic_plugin_type = "imager"
45 46
46 @classmethod
47 def check_image_exists(self, destdir, apacking=None,
48 images=(),
49 release=None):
50
51 # if it's a packing file, reset images
52 if apacking:
53 images = [apacking]
54
55 # release option will override images
56 if release is not None:
57 images = [os.path.basename(destdir.rstrip('/'))]
58 destdir = os.path.dirname(destdir.rstrip('/'))
59
60 for name in images:
61 if not name:
62 continue
63
64 image = os.path.join(destdir, name)
65 if not os.path.exists(image):
66 continue
67
68 if msger.ask("Target image/dir: %s already exists, "
69 "clean up and continue?" % image):
70 if os.path.isdir(image):
71 shutil.rmtree(image)
72 else:
73 os.unlink(image)
74 else:
75 raise errors.Abort("Cancled")
76
77 def do_create(self):
78 pass
79
80 def do_chroot(self):
81 pass
82 47
83class SourcePlugin(_Plugin): 48class SourcePlugin(_Plugin):
84 mic_plugin_type = "source" 49 mic_plugin_type = "source"
@@ -133,12 +98,6 @@ class SourcePlugin(_Plugin):
133 """ 98 """
134 msger.debug("SourcePlugin: do_prepare_partition: part: %s" % part) 99 msger.debug("SourcePlugin: do_prepare_partition: part: %s" % part)
135 100
136class BackendPlugin(_Plugin):
137 mic_plugin_type="backend"
138
139 def addRepository(self):
140 pass
141
142def get_plugins(typen): 101def get_plugins(typen):
143 ps = ImagerPlugin.get_plugins() 102 ps = ImagerPlugin.get_plugins()
144 if typen in ps: 103 if typen in ps:
@@ -146,4 +105,4 @@ def get_plugins(typen):
146 else: 105 else:
147 return None 106 return None
148 107
149__all__ = ['ImagerPlugin', 'BackendPlugin', 'SourcePlugin', 'get_plugins'] 108__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 e69de29bb2..0000000000
--- a/scripts/lib/mic/plugins/hook/.py
+++ /dev/null
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 397585d8c1..0000000000
--- a/scripts/lib/mic/plugins/hook/empty_hook.py
+++ /dev/null
@@ -1,3 +0,0 @@
1#!/usr/bin/python
2
3# TODO: plugin base for hooks
diff --git a/scripts/lib/mic/utils/errors.py b/scripts/lib/mic/utils/errors.py
index 8d720f9080..38fda307cf 100644
--- a/scripts/lib/mic/utils/errors.py
+++ b/scripts/lib/mic/utils/errors.py
@@ -43,29 +43,8 @@ class Usage(CreatorError):
43class Abort(CreatorError): 43class Abort(CreatorError):
44 keyword = '' 44 keyword = ''
45 45
46class ConfigError(CreatorError):
47 keyword = '<config>'
48
49class KsError(CreatorError): 46class KsError(CreatorError):
50 keyword = '<kickstart>' 47 keyword = '<kickstart>'
51 48
52class RepoError(CreatorError):
53 keyword = '<repo>'
54
55class RpmError(CreatorError):
56 keyword = '<rpm>'
57
58class MountError(CreatorError): 49class MountError(CreatorError):
59 keyword = '<mount>' 50 keyword = '<mount>'
60
61class SnapshotError(CreatorError):
62 keyword = '<snapshot>'
63
64class SquashfsError(CreatorError):
65 keyword = '<squashfs>'
66
67class BootstrapError(CreatorError):
68 keyword = '<bootstrap>'
69
70class RuntimeError(CreatorError):
71 keyword = '<runtime>'