From 8c1637e938416e068a086071d133b596543c9ecd Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Tue, 16 Dec 2014 16:05:46 +0000 Subject: 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. --- pxeboot.check | 3 +-- 1 file changed, 1 insertion(+), 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'] -- cgit v1.2.1