From fac92f615e6c702f66795f8428d8ddc49c782f32 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Tue, 19 Aug 2014 16:49:39 +0200 Subject: [PATCH] labs: split out vm_init_node Move the initial creation and configuration of a node into a separate function. Follow-up patches give the option to omit a call to this function, which allows osbash to continue work on a node rather than having to recreate it for each run. Change-Id: Id58a5f572de0b6453cf24533b2b4e2337f35803f Implements: blueprint openstack-training-labs --- labs/lib/osbash/virtualbox.install_node | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/labs/lib/osbash/virtualbox.install_node b/labs/lib/osbash/virtualbox.install_node index 0e30cc1d..1d64e962 100644 --- a/labs/lib/osbash/virtualbox.install_node +++ b/labs/lib/osbash/virtualbox.install_node @@ -35,13 +35,9 @@ function _vbox_boot_with_autostart { echo >&2 "VM \"$VM\": autostart files executed" } -function vm_build_node { - # XXX Run this function in sub-shell to protect our caller's environment - # (which might be _our_ enviroment if we get called again) - ( - +# Create a new node VM and run basic configuration scripts +function vm_init_node { NODE_NAME=$1 - source "$CONFIG_DIR/config.$NODE_NAME" ${WBATCH:-:} wbatch_begin_node "$NODE_NAME" @@ -70,7 +66,17 @@ function vm_build_node { # Rename to pass the node name to the script autostart_and_rename osbash init_xxx_node.sh "init_${NODE_NAME}_node.sh" autostart_from_config scripts.nodeinit_osbash +} +function vm_build_node { + # XXX Run this function in sub-shell to protect our caller's environment + # (which might be _our_ enviroment if we get called again) + ( + + NODE_NAME=$1 + source "$CONFIG_DIR/config.$NODE_NAME" + + vm_init_node "$NODE_NAME" #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - autostart_reset autostart_from_config "scripts.$NODE_NAME"