From 708ab4e3e80dc4b2b53a69d9059b34168e724cbe Mon Sep 17 00:00:00 2001 From: JF Ding Date: Thu, 22 Sep 2011 17:58:36 +0800 Subject: [PATCH] show available pkgmgrs if invalid one encountered --- plugins/imager/fs_plugin.py | 3 ++- plugins/imager/livecd_plugin.py | 3 ++- plugins/imager/liveusb_plugin.py | 3 ++- plugins/imager/loop_plugin.py | 3 ++- plugins/imager/raw_plugin.py | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/plugins/imager/fs_plugin.py b/plugins/imager/fs_plugin.py index 971adca..616b557 100644 --- a/plugins/imager/fs_plugin.py +++ b/plugins/imager/fs_plugin.py @@ -62,7 +62,8 @@ class FsPlugin(ImagerPlugin): break if not pkgmgr: - raise errors.CreatorError("Can't find backend plugin: %s" % createopts['pkgmgr']) + pkgmgrs = pluginmgr.PluginMgr().get_plugins('backend').keys() + raise errors.CreatorError("Can't find package manager: %s (availables: %s)" % (createopts['pkgmgr'], ', '.join(pkgmgrs))) creator = fs.FsImageCreator(createopts, pkgmgr) creator._include_src = opts.include_src diff --git a/plugins/imager/livecd_plugin.py b/plugins/imager/livecd_plugin.py index 1d9e9c5..1fa6256 100644 --- a/plugins/imager/livecd_plugin.py +++ b/plugins/imager/livecd_plugin.py @@ -67,7 +67,8 @@ class LiveCDPlugin(ImagerPlugin): break if not pkgmgr: - raise errors.CreatorError("Can't find package manager: %s" % creatoropts['pkgmgr']) + pkgmgrs = pluginmgr.PluginMgr().get_plugins('backend').keys() + raise errors.CreatorError("Can't find package manager: %s (availables: %s)" % (creatoropts['pkgmgr'], ', '.join(pkgmgrs))) creator = livecd.LiveCDImageCreator(creatoropts, pkgmgr) diff --git a/plugins/imager/liveusb_plugin.py b/plugins/imager/liveusb_plugin.py index 02cfaf9..89428a1 100644 --- a/plugins/imager/liveusb_plugin.py +++ b/plugins/imager/liveusb_plugin.py @@ -69,7 +69,8 @@ class LiveUSBPlugin(ImagerPlugin): break if not pkgmgr: - raise errors.CreatorError("Can't find package manager: %s" % creatoropts['pkgmgr']) + pkgmgrs = pluginmgr.PluginMgr().get_plugins('backend').keys() + raise errors.CreatorError("Can't find package manager: %s (availables: %s)" % (creatoropts['pkgmgr'], ', '.join(pkgmgrs))) creator = liveusb.LiveUSBImageCreator(creatoropts, pkgmgr) diff --git a/plugins/imager/loop_plugin.py b/plugins/imager/loop_plugin.py index 26d1a2b..52eb29c 100644 --- a/plugins/imager/loop_plugin.py +++ b/plugins/imager/loop_plugin.py @@ -76,7 +76,8 @@ class LoopPlugin(ImagerPlugin): break if not pkgmgr: - raise errors.CreatorError("Can't find package manager: %s" % creatoropts['pkgmgr']) + pkgmgrs = pluginmgr.PluginMgr().get_plugins('backend').keys() + raise errors.CreatorError("Can't find package manager: %s (availables: %s)" % (creatoropts['pkgmgr'], ', '.join(pkgmgrs))) creator = loop.LoopImageCreator(creatoropts, pkgmgr, extra_loop) diff --git a/plugins/imager/raw_plugin.py b/plugins/imager/raw_plugin.py index 5f58001..d60bc31 100644 --- a/plugins/imager/raw_plugin.py +++ b/plugins/imager/raw_plugin.py @@ -66,7 +66,8 @@ class RawPlugin(ImagerPlugin): break if not pkgmgr: - raise errors.CreatorError("Can't find package manager: %s" % creatoropts['pkgmgr']) + pkgmgrs = pluginmgr.PluginMgr().get_plugins('backend').keys() + raise errors.CreatorError("Can't find package manager: %s (availables: %s)" % (creatoropts['pkgmgr'], ', '.join(pkgmgrs))) creator = raw.RawImageCreator(creatoropts, pkgmgr) -- 2.7.4