summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpxeboot.check10
1 files changed, 6 insertions, 4 deletions
diff --git a/pxeboot.check b/pxeboot.check
index d7eb9b5c..d17f64c0 100755
--- a/pxeboot.check
+++ b/pxeboot.check
@@ -18,15 +18,17 @@ valid_option_sets = frozenset((
('existing-server', frozenset(('PXEBOOT_CONFIG_TFTP_ADDRESS',
'PXEBOOT_ROOTFS_RSYNC_ADDRESS'))),
))
-valid_modes = frozenset(mode for (mode, opt_set in valid_option_sets))
+valid_modes = frozenset(mode for mode, opt_set in valid_option_sets)
def compute_matches(env):
complete_matches = set()
for mode, opt_set in valid_option_sets:
- if all(k in env for k in opt_set):
- complete_matches.add(opt_set)
+ if mode == os.environ['PXEBOOT_MODE']:
+ if all(k in env for k in opt_set):
+ complete_matches.add(opt_set)
return complete_matches
+
complete_matches = compute_matches(os.environ)
def word_separate_options(options):
@@ -39,7 +41,7 @@ def word_separate_options(options):
valid_options = frozenset(flatten(opt_set for (mode, opt_set)
in valid_option_sets))
-matched_options = frozenset(o for o in valid_options)
+matched_options = frozenset(o for o in valid_options
if o in os.environ)
if not complete_matches:
addable_sets = frozenset(frozenset(os) - matched_options for os in