From c643ebb26dac484e56aea7b5f30d97fe7711f6f3 Mon Sep 17 00:00:00 2001 From: Bob Ball Date: Sun, 2 Feb 2014 09:16:20 +0000 Subject: [PATCH] XenAPI: Fix new useage of trueorfalse * Ensure that Xen setup scripts will continue to function when unset variables are used in stackrc * Ensure that the generic functions are sourced in all places that xenrc (which sources stackrc) is sourced. Change-Id: I54eba20733c2e149621b74a1387f0bef14fca12e --- tools/xen/build_xva.sh | 10 ++++++++++ tools/xen/prepare_guest_template.sh | 10 ++++++++++ tools/xen/xenrc | 3 +++ 3 files changed, 23 insertions(+) diff --git a/tools/xen/build_xva.sh b/tools/xen/build_xva.sh index 958102b29c..fbbfd6fbe5 100755 --- a/tools/xen/build_xva.sh +++ b/tools/xen/build_xva.sh @@ -21,9 +21,19 @@ set -o xtrace # This directory TOP_DIR=$(cd $(dirname "$0") && pwd) +# Source lower level functions +. $TOP_DIR/../../functions + # Include onexit commands . $TOP_DIR/scripts/on_exit.sh +# xapi functions +. $TOP_DIR/functions + +# Determine what system we are running on. +# Might not be XenServer if we're using xenserver-core +GetDistro + # Source params - override xenrc params in your localrc to suite your taste source xenrc diff --git a/tools/xen/prepare_guest_template.sh b/tools/xen/prepare_guest_template.sh index 546ac99cd9..4fa70d377d 100755 --- a/tools/xen/prepare_guest_template.sh +++ b/tools/xen/prepare_guest_template.sh @@ -22,9 +22,19 @@ set -o xtrace # This directory TOP_DIR=$(cd $(dirname "$0") && pwd) +# Source lower level functions +. $TOP_DIR/../../functions + # Include onexit commands . $TOP_DIR/scripts/on_exit.sh +# xapi functions +. $TOP_DIR/functions + +# Determine what system we are running on. +# Might not be XenServer if we're using xenserver-core +GetDistro + # Source params - override xenrc params in your localrc to suite your taste source xenrc diff --git a/tools/xen/xenrc b/tools/xen/xenrc index cd282341cb..96f3734a1d 100644 --- a/tools/xen/xenrc +++ b/tools/xen/xenrc @@ -91,4 +91,7 @@ UBUNTU_INST_GATEWAY="" # Set the size to 0 to avoid creation of additional disk. XEN_XVDB_SIZE_GB=0 +restore_nounset=`set +o | grep nounset` +set +u source ../../stackrc +$restore_nounset