Patchwork [3/5] wic: Print error if a partition specifies an invalid --source

login
register
mail settings
Submitter tom.zanussi@linux.intel.com
Date July 8, 2014, 2:51 p.m.
Message ID <2bdfc41eabf5c876d0fe2f75584d3cb930b46539.1404830754.git.tom.zanussi@linux.intel.com>
Download mbox | patch
Permalink /patch/75183/
State Accepted
Commit b5dceca4369ef2ae0825d5298aa640b68d7d7da1
Headers show

Comments

tom.zanussi@linux.intel.com - July 8, 2014, 2:51 p.m.
If a partition specified in a .wks file specifies a nonexistent
--source, print an error to that effect and exit.  The error text also
points the user to a command listing valid sources, and help on adding
a new source plugin.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/lib/mic/kickstart/custom_commands/partition.py | 5 +++++
 1 file changed, 5 insertions(+)

Patch

diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
index 6b575c0..75ad6ad 100644
--- a/scripts/lib/mic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
@@ -130,6 +130,11 @@  class Wic_PartData(Mic_PartData):
                                              native_sysroot)
             return
 
+        plugins = pluginmgr.get_source_plugins()
+
+        if self.source not in plugins:
+            msger.error("The '%s' --source specified for %s doesn't exist.\n\tSee 'wic list source-plugins' for a list of available --sources.\n\tSee 'wic help source-plugins' for details on adding a new source plugin." % (self.source, self.mountpoint))
+
         self._source_methods = pluginmgr.get_source_plugin_methods(self.source, partition_methods)
         self._source_methods["do_configure_partition"](self, cr, cr_workdir,
                                                        oe_builddir,