summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-12-08 15:37:24 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-12-08 15:37:24 +0000
commitaa6a4bb91f1f3f2391058427feb0d3ed2338ae89 (patch)
treef78813c1808abad520d589a28e3c102d32d16e00
parent79c87e5bba33f97d0a40ca0fd0f83b6852735a05 (diff)
downloaddefinitions-aa6a4bb91f1f3f2391058427feb0d3ed2338ae89.tar.gz
pxeboot-check-fixups
-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