From b00fdddbe1064122cf77ce5755295357a46b7f00 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Mon, 4 Aug 2014 10:54:40 +0200 Subject: [PATCH] labs: explain host/VM script interaction This patch adds a few comments to help the reader understand how host (osbash, wbatch) scripts and VM scripts interact. Change-Id: I1dd07d131877200d65664ab98c39d621df3e3604 Implements: blueprint openstack-training-labs --- labs/lib/functions.guest | 4 +++- labs/lib/osbash/functions.host | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/labs/lib/functions.guest b/labs/lib/functions.guest index 116af206..2772b864 100644 --- a/labs/lib/functions.guest +++ b/labs/lib/functions.guest @@ -35,7 +35,9 @@ function zero_empty_space { sudo rm /filler } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Used by guest scripts to let osbash know they are running +# For guest scripts to let osbash know they are running; used when osbashauto +# runs scripts inside of the VM (STATUS_DIR directory must be shared between +# host and VM). function indicate_current_auto { if [ "${VM_SHELL_USER:-}" = "osbash" ]; then diff --git a/labs/lib/osbash/functions.host b/labs/lib/osbash/functions.host index 7d20be83..59777dfe 100644 --- a/labs/lib/osbash/functions.host +++ b/labs/lib/osbash/functions.host @@ -154,6 +154,8 @@ function autostart_reset { clean_dir "$STATUS_DIR" } +# Wait until all autofiles are processed (indicated by a "$STATUS_DIR/done" +# file created either by osbashauto or ssh_process_autostart) function wait_for_autofiles { local DONE=false shopt -s nullglob @@ -169,7 +171,8 @@ function wait_for_autofiles { rm "$STATUS_DIR/done" # Return only after checking for remaining *.sh.begin files fi - # Note: begin files are only visible with a VirtualBox shared folder + # Note: begin files (created by indicate_current_auto) are only visible + # if the STATUS_DIR directory is shared between host and VM local PROCESSING=("$STATUS_DIR"/*.sh.begin) if [ -n "${PROCESSING[0]-}" ]; then for f in "${PROCESSING[@]}"; do