diff --git a/devstack/lib/ironic b/devstack/lib/ironic index a39d025197..8c5cabb9fe 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -817,6 +817,10 @@ function upload_baremetal_ironic_deploy { } function prepare_baremetal_basic_ops { + if [[ "$IRONIC_BAREMETAL_BASIC_OPS" != "True" ]]; then + return 0 + fi + if ! is_ironic_hardware; then configure_ironic_auxiliary fi @@ -830,6 +834,9 @@ function prepare_baremetal_basic_ops { } function cleanup_baremetal_basic_ops { + if [[ "$IRONIC_BAREMETAL_BASIC_OPS" != "True" ]]; then + return 0 + fi rm -f $IRONIC_VM_MACS_CSV_FILE if [ -f $IRONIC_KEY_FILE ]; then local key diff --git a/devstack/plugin.sh b/devstack/plugin.sh index fc2fd9734d..de584e6d9a 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -25,17 +25,12 @@ if is_service_enabled ir-api ir-cond; then # Start the ironic API and ironic taskmgr components echo_summary "Starting Ironic" start_ironic - - if [[ "$IRONIC_BAREMETAL_BASIC_OPS" = "True" ]]; then - prepare_baremetal_basic_ops - fi + prepare_baremetal_basic_ops fi if [[ "$1" == "unstack" ]]; then stop_ironic - if [[ "$IRONIC_BAREMETAL_BASIC_OPS" = "True" ]]; then - cleanup_baremetal_basic_ops - fi + cleanup_baremetal_basic_ops fi if [[ "$1" == "clean" ]]; then