From 778fcdafa4d6f22677b007db1796af8d24f61bba Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Thu, 10 Dec 2015 15:19:29 +0000 Subject: [PATCH] Clean up variables in plugin.sh These are defined in lib/ironic, so use them there instead of plugin.sh to make the plugin a bit cleaner. Change-Id: I0d536ad7ba9b4ff4473a973ea13100e924ee9ce5 --- devstack/lib/ironic | 7 +++++++ devstack/plugin.sh | 9 ++------- 2 files changed, 9 insertions(+), 7 deletions(-) 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