__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
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"
"""
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:
else:
return None
-__all__ = ['ImagerPlugin', 'BackendPlugin', 'SourcePlugin', 'get_plugins']
+__all__ = ['ImagerPlugin', 'SourcePlugin', 'get_plugins']
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>'