From ab6a2557d404619698ef255a585b82edae35368e Mon Sep 17 00:00:00 2001 From: rajat29 Date: Tue, 5 Sep 2017 12:40:49 +0530 Subject: [PATCH] Fix to use . to source script files Adhering to coding conventions. Refer to ``Code conventions`` at https://docs.openstack.org/contributor-guide/ for details. When you have to source a script file, for example, a credentials file to gain access to user-only or admin-only CLI commands, use . instead of source. https://docs.openstack.org/contributor-guide/writing-style/code-conventions.html Change-Id: I267e2282345b5cb97eba8d0c844417354ec24f4c --- devstack/lib/tacker | 4 ++-- devstack/local.sh.mysql_fix | 6 +++--- devstack/plugin.sh | 2 +- doc/source/contributor/encrypt_vim_auth_with_barbican.rst | 2 +- tacker/tests/contrib/post_test_hook.sh | 4 ++-- tools/install_venv.py | 2 +- tools/prepare_functional_test.sh | 4 ++-- tools/with_venv.sh | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/devstack/lib/tacker b/devstack/lib/tacker index 21b381d15..c4511461e 100644 --- a/devstack/lib/tacker +++ b/devstack/lib/tacker @@ -427,13 +427,13 @@ function tacker_register_default_vim { $TOP_DIR/tools/create_userrc.sh -P -u $DEFAULT_VIM_USER -C $DEFAULT_VIM_PROJECT_NAME -p $DEFAULT_VIM_PASSWORD echo "Switch environment openrc:" echo $(cat $TOP_DIR/accrc/$DEFAULT_VIM_PROJECT_NAME/$DEFAULT_VIM_USER) - source $TOP_DIR/accrc/$DEFAULT_VIM_PROJECT_NAME/$DEFAULT_VIM_USER + . $TOP_DIR/accrc/$DEFAULT_VIM_PROJECT_NAME/$DEFAULT_VIM_USER default_vim_id=$(tacker vim-register --is-default --description "Default VIM" --config-file $VIM_CONFIG_FILE $DEFAULT_VIM_NAME -c id | grep id | awk '{print $4}') echo "Default VIM registration done as $default_vim_id at $KEYSTONE_SERVICE_URI." echo "Switch back to old environment openrc:" echo $(cat $TOP_DIR/accrc/$old_project/$old_user) - source $TOP_DIR/accrc/$old_project/$old_user + . $TOP_DIR/accrc/$old_project/$old_user echo "Update tacker/tests/etc/samples/local-vim.yaml for functional testing" functional_vim_file="$TACKER_DIR/tacker/tests/etc/samples/local-vim.yaml" diff --git a/devstack/local.sh.mysql_fix b/devstack/local.sh.mysql_fix index 4f9086dfa..a4522ad60 100755 --- a/devstack/local.sh.mysql_fix +++ b/devstack/local.sh.mysql_fix @@ -13,10 +13,10 @@ TOP_DIR=$(cd $(dirname "$0") && pwd) # Import common functions -source $TOP_DIR/functions +. $TOP_DIR/functions # Use openrc + stackrc + localrc for settings -source $TOP_DIR/stackrc +. $TOP_DIR/stackrc # Destination path for installation ``DEST`` DEST=${DEST:-/opt/stack} @@ -38,7 +38,7 @@ if is_service_enabled mysql; then exit_distro_not_supported "mysql configuration" fi - sudo bash -c "source $TOP_DIR/functions && \ + sudo bash -c ". $TOP_DIR/functions && \ iniset $my_conf mysqld max_connections 1024 && \ iniset $my_conf mysqld query_cache_type OFF && \ iniset $my_conf mysqld query_cache_size 0" diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 3c8584aa1..7a9457924 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -5,7 +5,7 @@ XTRACE=$(set +o | grep xtrace) set -o xtrace echo_summary "tacker's plugin.sh was called..." -source $DEST/tacker/devstack/lib/tacker +. $DEST/tacker/devstack/lib/tacker (set -o posix; set) # check for service enabled diff --git a/doc/source/contributor/encrypt_vim_auth_with_barbican.rst b/doc/source/contributor/encrypt_vim_auth_with_barbican.rst index 89ecab831..1c3f9e256 100644 --- a/doc/source/contributor/encrypt_vim_auth_with_barbican.rst +++ b/doc/source/contributor/encrypt_vim_auth_with_barbican.rst @@ -41,7 +41,7 @@ Create a vim and verify it works: .. code-block:: bash - $ source openrc-admin.sh + $ . openrc-admin.sh $ openstack project create test $ openstack user create --password a test $ openstack role add --project test --user test admin diff --git a/tacker/tests/contrib/post_test_hook.sh b/tacker/tests/contrib/post_test_hook.sh index b6845760b..9105960a4 100755 --- a/tacker/tests/contrib/post_test_hook.sh +++ b/tacker/tests/contrib/post_test_hook.sh @@ -53,14 +53,14 @@ function generate_testr_results { fi } -source ${TACKER_DIR}/tacker/tests/contrib/post_test_hook_lib.sh +. ${TACKER_DIR}/tacker/tests/contrib/post_test_hook_lib.sh if [[ "$venv" == dsvm-functional* ]] then owner=stack sudo_env= log_dir="/tmp/${venv}-logs" - source $DEVSTACK_DIR/openrc admin admin + . $DEVSTACK_DIR/openrc admin admin fixup_quota add_key add_secgrp diff --git a/tools/install_venv.py b/tools/install_venv.py index 40e597e20..8313474d1 100644 --- a/tools/install_venv.py +++ b/tools/install_venv.py @@ -40,7 +40,7 @@ def print_help(): To activate the Tacker virtualenv for the extent of your current shell session you can run: - $ source .venv/bin/activate + $ . .venv/bin/activate Or, if you prefer, you can run commands in the virtualenv on a case by case basis by running: diff --git a/tools/prepare_functional_test.sh b/tools/prepare_functional_test.sh index 8dd75a411..c84b35f7f 100755 --- a/tools/prepare_functional_test.sh +++ b/tools/prepare_functional_test.sh @@ -12,8 +12,8 @@ if [ ! -f ${DEVSTACK_DIR}/openrc ]; then exit 1 fi -source $DEVSTACK_DIR/openrc admin admin -source ${TACKER_DIR}/tacker/tests/contrib/post_test_hook_lib.sh +. $DEVSTACK_DIR/openrc admin admin +. ${TACKER_DIR}/tacker/tests/contrib/post_test_hook_lib.sh fixup_quota add_key_if_not_exist diff --git a/tools/with_venv.sh b/tools/with_venv.sh index 780558301..72f68f7b2 100755 --- a/tools/with_venv.sh +++ b/tools/with_venv.sh @@ -17,4 +17,4 @@ TOOLS=`dirname $0` VENV=$TOOLS/../.venv -source $VENV/bin/activate && "$@" +. $VENV/bin/activate && "$@"