From 5ca2b349a216b193bfc379f44b0616718df5d524 Mon Sep 17 00:00:00 2001 From: Anthony Lin Date: Mon, 5 Feb 2018 17:56:22 +0000 Subject: [PATCH] Bug Fix - set_env file Tested the scripts in the Atlanta Lab and ran into issues with 'max_shipyard_count' and 'shipyard_query_time' variables as we will need to export them as environment variables as well. This patch set is meant to correct the problem. Change-Id: I0ae407adac3df6a0cbe027a70940ee65904a7854 --- tools/execute_shipyard_action.sh | 6 +++--- tools/set_env | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/execute_shipyard_action.sh b/tools/execute_shipyard_action.sh index d39603b9..434ca96c 100755 --- a/tools/execute_shipyard_action.sh +++ b/tools/execute_shipyard_action.sh @@ -22,7 +22,7 @@ check_timeout_counter() { # Check total elapsed time # The default time out is set to 1.5 hr - if [[ $counter -ge $max_count ]]; then + if [[ $counter -ge $max_shipyard_count ]]; then echo 'Worflow Execution Timed Out!' break fi @@ -109,8 +109,8 @@ run_action () { echo -e "Dag Execution is in" ${GREEN}$action_lifecycle${NC} "state\n" # Back off between each iteration - echo -e "Back Off for $query_time seconds...\n" - sleep $query_time + echo -e "Back Off for $shipyard_query_time seconds...\n" + sleep $shipyard_query_time # Step counter and check the timeout counter ((counter++)) diff --git a/tools/set_env b/tools/set_env index a095c17a..69fe3caa 100755 --- a/tools/set_env +++ b/tools/set_env @@ -14,16 +14,16 @@ # limitations under the License. # Define Variable -# Note that 'query_time' has a default value of 90 seconds -# Note that 'max_count' has a default value of 60 loops (based on +namespace="${namespace:-ucp}" + +# Export Environment Variables +# Note that 'shipyard_query_time' has a default value of 90 seconds +# Note that 'max_shipyard_count' has a default value of 60 loops (based on # 90 seconds back off per cycle, i.e. 60 * 90 = 5400 seconds = 1.5 hr) # Note that user can use a different value for each of the variables by # exporting the required environment variable prior to running the script -max_count=${max_count:-60} -namespace="${namespace:-ucp}" -query_time=${query_time:-90} - -# Export Environment Variables +export max_shipyard_count=${max_shipyard_count:-60} +export shipyard_query_time=${shipyard_query_time:-90} export OS_AUTH_URL="${OS_AUTH_URL:-http://keystone.${namespace}:80/v3}" export OS_PASSWORD="${OS_PASSWORD:-password}" export OS_PROJECT_DOMAIN_NAME="${OS_PROJECT_DOMAIN_NAME:-default}"