From cc69365a5a68dd4b22dd30ea18d8486223137aab Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 7 Aug 2015 10:10:29 +1000 Subject: [PATCH] Reduce duplicate imports of functions & stackrc In devstack openrc -> stackrc -> functions I think it's fair to say nobody is really thinking about idempotency when they write these rc files; it's assumed they're sourced once per-run. I3ca4e576aa3fb8992c08ca44900a8c53dd4b4163 is an example of this. Reduce some of the duplicate imports here by just importing the top-level (either openrc if that's wanted, or stackrc) Change-Id: I6fbae12f950a03afab39f341132746d3db9f788c --- clean.sh | 2 -- inc/upgrade | 1 - prep-target | 3 +-- upgrade-tempest | 3 +-- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/clean.sh b/clean.sh index 83283eeb..59e0a351 100755 --- a/clean.sh +++ b/clean.sh @@ -29,7 +29,6 @@ set -o xtrace if [[ -d $BASE_DEVSTACK_DIR ]]; then bash -c " cd $BASE_DEVSTACK_DIR; \ - source functions; \ source stackrc; \ source lib/tls; \ source lib/cinder; \ @@ -47,7 +46,6 @@ fi if [[ -d $TARGET_DEVSTACK_DIR ]]; then bash -x -c " cd $TARGET_DEVSTACK_DIR; \ - source functions; \ source stackrc; \ source lib/tls; \ source lib/cinder; \ diff --git a/inc/upgrade b/inc/upgrade index ee85cc76..78962809 100644 --- a/inc/upgrade +++ b/inc/upgrade @@ -53,7 +53,6 @@ function upgrade_service { enabled="True" else enabled=$( - source $TARGET_DEVSTACK_DIR/functions; source $TARGET_DEVSTACK_DIR/stackrc; is_service_enabled $local_service || echo "False") fi diff --git a/prep-target b/prep-target index 86135342..af724acc 100755 --- a/prep-target +++ b/prep-target @@ -29,8 +29,7 @@ if [[ -d $BASE_RELEASE_DIR/images ]]; then rsync -a $BASE_RELEASE_DIR/images $TARGET_DEVSTACK_DIR/files fi -# Get target config -source $TARGET_DEVSTACK_DIR/functions +# Get target config (stackrc grabs devstack "functions" too) source $TARGET_DEVSTACK_DIR/stackrc # Build a wheel cache diff --git a/upgrade-tempest b/upgrade-tempest index d11e683c..827052d2 100755 --- a/upgrade-tempest +++ b/upgrade-tempest @@ -40,8 +40,7 @@ GetDistro TOP_DIR=$TARGET_DEVSTACK_DIR cd $TARGET_DEVSTACK_DIR -source $TARGET_DEVSTACK_DIR/functions -source $TARGET_DEVSTACK_DIR/stackrc + # note; openrc sources functions & stackrc source $TARGET_DEVSTACK_DIR/openrc FILES=$TARGET_DEVSTACK_DIR/files