Skip to content

Commit

Permalink
Fix 'noconfirm' not respecting bootloader property
Browse files Browse the repository at this point in the history
  • Loading branch information
johnramsden committed Aug 27, 2018
1 parent 4cf21b9 commit 2623e41
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions zedenv/cli/activate.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ def zedenv_activate(boot_environment: str,
"message": f"Failed to get active boot environment'\n"
}, exit_on_error=True)

bootloader_set = zedenv.lib.be.get_property(be_requested, "org.zedenv:bootloader")
if not bootloader and bootloader_set:
bootloader = bootloader_set if bootloader_set != '-' else None

bootloader_plugin = None
if bootloader:
bootloader_plugin = zedenv.lib.configure.get_bootloader(
Expand Down Expand Up @@ -335,16 +331,23 @@ def cli(boot_environment: str,
noconfirm: Optional[bool],
noop: Optional[bool]):

if noconfirm and not bootloader:
sys.exit("The '--noconfirm/-y' flag requires the bootloader option '--bootloader/-b'.")

try:
zedenv.lib.check.startup_check()
except RuntimeError as err:
ZELogger.log({"level": "EXCEPTION", "message": err}, exit_on_error=True)

boot_environment_root = zedenv.lib.be.root()

bootloader_set = zedenv.lib.be.get_property(
f"{boot_environment_root}/{boot_environment}", "org.zedenv:bootloader")
if not bootloader and bootloader_set:
bootloader = bootloader_set if bootloader_set != '-' else None

if noconfirm and not bootloader:
sys.exit("The '--noconfirm/-y' flag requires the bootloader option '--bootloader/-b'.")

zedenv_activate(boot_environment,
zedenv.lib.be.root(),
boot_environment_root,
verbose,
bootloader,
noconfirm,
Expand Down

0 comments on commit 2623e41

Please sign in to comment.