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-23 16:27:56 +0100
commit8c1637e938416e068a086071d133b596543c9ecd (patch)
tree664f0ee918e4c1d5ba80b347ff2e49b76f042b70
parentac3dbaebc8084886a1f7aedb07db203d472d763a (diff)
downloaddefinitions-8c1637e938416e068a086071d133b596543c9ecd.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']