summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-12-16 16:05:46 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-12-16 17:56:09 +0000
commit3169683f2a9ab356b5bea1f1afba01621b6fc80b (patch)
treeac2d36a0f293bc83af7efa0ef07e6315a9a85db5
parentfeabf61d42f1b6cb0bf4de0f5cf4410ff691812f (diff)
downloaddefinitions-3169683f2a9ab356b5bea1f1afba01621b6fc80b.tar.gz
pxeboot.check: Multiple complete_matches is not an error
The code was assuming that if there are more than one complete_match we were setting more options that needed and this is not always true. For example when setting 'PXEBOOT_DEPLOYER_INTERFACE' and 'PXEBOOT_VLAN', there will be more than one complete_matches, given that these options match the spawn-vlan and the spawn-novlan modes. My workaround consists on report warning messages instead of failing when this happens. The reason that I haven't removed the code is that I think that it could be fixable. For now this code will report "warnings" instead of failing.
-rwxr-xr-xpxeboot.check3
1 files changed, 1 insertions, 2 deletions
diff --git a/pxeboot.check b/pxeboot.check
index 97b87d22..df1fcc0e 100755
--- a/pxeboot.check
+++ b/pxeboot.check
@@ -54,10 +54,9 @@ elif len(complete_matches) > 1:
removable_sets = frozenset(matched_options - frozenset(os) for os in
powerset(matched_options)
if len(compute_matches(os)) == 1)
- print('Please unset %s' % ' or '.join(
+ print('WARNING: Following options might not be needed: %s' % ' or '.join(
word_separate_options(list(opt_set))
for opt_set in removable_sets if opt_set))
- sys.exit(1)
if 'PXEBOOT_MODE' in os.environ:
mode = os.environ['PXEBOOT_MODE']