Shellcheck warnings fix

In ./gen_password.sh line 5:
function gen_pass {
^-- SC2113: 'function' keyword is non-standard. Use 'foo()' instead of
'function foo'.

In ./deployment_scripts/puppet/modules/manila_auxiliary/files/meta.sh line 5:
if [[ -z $(manila type-list|grep default_share_type) ]]; then
      ^-- SC2143: Instead of [ -z $(foo | grep bar) ], use ! foo | grep -q bar .

In ./deployment_scripts/puppet/modules/manila_auxiliary/files/meta.sh line 10:
if [[ -z $(manila share-network-list| grep test_share_network) ]];then
      ^-- SC2143: Instead of [ -z $(foo | grep bar) ], use ! foo | grep -q bar .

In ./deployment_scripts/puppet/modules/manila_auxiliary/files/meta.sh line 20:
if [[ -z $(openstack flavor list|grep manila-service-flavor) ]];then
      ^-- SC2143: Instead of [ -z $(foo | grep bar) ], use ! foo | grep -q bar .

Change-Id: I7f30e99d870ceb45ca4b43f94bd456ae5891878a
This commit is contained in:
Ruslan Khozinov 2016-08-18 16:59:52 +03:00
parent ee001d7b19
commit ac7d1503bd
2 changed files with 16 additions and 12 deletions

View File

@ -2,22 +2,26 @@
. /root/openrc
if [[ -z $(manila type-list|grep default_share_type) ]]; then
echo add default_share_type
if manila type-list | grep -q 'default_share_type'; then
echo 'add default_share_type'
manila type-create default_share_type True
fi
if [[ -z $(manila share-network-list| grep test_share_network) ]];then
echo add test_share_network
net_uid=$(neutron net-list|grep internal|cut -f2 -d' ')
subnet_uid=$(neutron net-list|grep internal|cut -f6 -d' ')
if manila share-network-list | grep -q 'test_share_network'; then
echo 'add test_share_network'
net_uid=$(neutron net-list | grep -q 'internal' | cut -f2 -d' ')
subnet_uid=$(neutron net-list | grep -q 'internal' | cut -f6 -d' ')
manila share-network-create \
--name test_share_network \
--neutron-net-id $net_uid \
--name test_share_network \
--neutron-net-id $net_uid \
--neutron-subnet-id $subnet_uid
fi
if [[ -z $(openstack flavor list|grep manila-service-flavor) ]];then
echo add manila-service-flavor
openstack flavor create manila-service-flavor --id 100 --ram 256 --disk 0 --vcpus 1
if openstack flavor list | grep -q 'manila-service-flavor'; then
echo 'add manila-service-flavor'
openstack flavor create manila-service-flavor \
--id 100 \
--ram 256 \
--disk 0 \
--vcpus 1
fi

View File

@ -2,7 +2,7 @@
CLUSTER_ID=$1
function gen_pass {
gen_pass() {
openssl rand -base64 32|tr -d '='
}