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-19 10:37:32 +0000
commit12f3681b335ae9b3a2f32e3e715d22f28eb7b7f4 (patch)
tree9b8961d557a0fb56db0c5962f8006863e7f6e18b
parent22c23ac590c67e1ff85bb5563d670cef30ce2e57 (diff)
downloaddefinitions-12f3681b335ae9b3a2f32e3e715d22f28eb7b7f4.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']