From 44b49adda1650d66f0c19c0a7a35352b854980cc Mon Sep 17 00:00:00 2001 From: ZhijunWei Date: Sat, 28 Apr 2018 15:41:54 +0000 Subject: [PATCH] Add test for credentials set the /etc/kolla/adminrc.sh should be export before init vpn script, this ps to add test for credentials set to avoid it missing. Change-Id: Ib849d5f5804221c507c2466f2f08179340188c24 --- tools/init-vpn | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/init-vpn b/tools/init-vpn index 4a7271dbb7..bdcc85c4b0 100755 --- a/tools/init-vpn +++ b/tools/init-vpn @@ -2,6 +2,12 @@ # Script originally copied from https://wiki.openstack.org/wiki/Neutron/VPNaaS/HowToInstall +# Test for credentials set +if [[ "${OS_USERNAME}" == "" ]]; then + echo "No Keystone credentials specified. Try running source openrc" + exit +fi + EXT_NW_ID=`neutron net-list | awk '/public/{print $2}'` WEST_SUBNET='192.168.1.0/24' EAST_SUBNET='192.168.2.0/24'