From 977c064105533212195ce7ccf2b186088fb90968 Mon Sep 17 00:00:00 2001 From: Pavlo Shchelokovskyy Date: Mon, 12 Jun 2017 08:04:57 +0000 Subject: [PATCH] Make default_boot_option configurable in devstack This patch adds an IRONIC_DEFAULT_BOOT_OPTION variable to our devstack plugin (defaulting to 'netboot'). This will allow for easier setup of a DevStack environment to test local boot with partition images. Change-Id: I97986e4627c6c5a014cc1507f655ea824f8ea7c8 --- devstack/lib/ironic | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/devstack/lib/ironic b/devstack/lib/ironic index a43333f5a6..5b9167ec6d 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -461,6 +461,12 @@ if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then fi fi +# TODO(dtantsur): change this when we change the default value. +IRONIC_DEFAULT_BOOT_OPTION=${IRONIC_DEFAULT_BOOT_OPTION:-netboot} +if [ $IRONIC_DEFAULT_BOOT_OPTION != 'netboot' ] && [ $IRONIC_DEFAULT_BOOT_OPTION != 'local' ]; then + die $LINENO "Supported values for IRONIC_DEFAULT_BOOT_OPTION are 'netboot' and 'local' only." +fi + # Functions # --------- @@ -1240,8 +1246,7 @@ function configure_ironic_conductor { iniset $IRONIC_CONF_FILE dhcp dhcp_provider $IRONIC_DHCP_PROVIDER - # TODO(dtantsur): change this when we change the default value. - iniset $IRONIC_CONF_FILE deploy default_boot_option netboot + iniset $IRONIC_CONF_FILE deploy default_boot_option $IRONIC_DEFAULT_BOOT_OPTION } # create_ironic_cache_dir() - Part of the init_ironic() process