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:
parent
ee001d7b19
commit
ac7d1503bd
|
@ -2,22 +2,26 @@
|
||||||
|
|
||||||
. /root/openrc
|
. /root/openrc
|
||||||
|
|
||||||
if [[ -z $(manila type-list|grep default_share_type) ]]; then
|
if manila type-list | grep -q 'default_share_type'; then
|
||||||
echo add default_share_type
|
echo 'add default_share_type'
|
||||||
manila type-create default_share_type True
|
manila type-create default_share_type True
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $(manila share-network-list| grep test_share_network) ]];then
|
if manila share-network-list | grep -q 'test_share_network'; then
|
||||||
echo add test_share_network
|
echo 'add test_share_network'
|
||||||
net_uid=$(neutron net-list|grep internal|cut -f2 -d' ')
|
net_uid=$(neutron net-list | grep -q 'internal' | cut -f2 -d' ')
|
||||||
subnet_uid=$(neutron net-list|grep internal|cut -f6 -d' ')
|
subnet_uid=$(neutron net-list | grep -q 'internal' | cut -f6 -d' ')
|
||||||
manila share-network-create \
|
manila share-network-create \
|
||||||
--name test_share_network \
|
--name test_share_network \
|
||||||
--neutron-net-id $net_uid \
|
--neutron-net-id $net_uid \
|
||||||
--neutron-subnet-id $subnet_uid
|
--neutron-subnet-id $subnet_uid
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $(openstack flavor list|grep manila-service-flavor) ]];then
|
if openstack flavor list | grep -q 'manila-service-flavor'; then
|
||||||
echo add manila-service-flavor
|
echo 'add manila-service-flavor'
|
||||||
openstack flavor create manila-service-flavor --id 100 --ram 256 --disk 0 --vcpus 1
|
openstack flavor create manila-service-flavor \
|
||||||
|
--id 100 \
|
||||||
|
--ram 256 \
|
||||||
|
--disk 0 \
|
||||||
|
--vcpus 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
CLUSTER_ID=$1
|
CLUSTER_ID=$1
|
||||||
|
|
||||||
function gen_pass {
|
gen_pass() {
|
||||||
openssl rand -base64 32|tr -d '='
|
openssl rand -base64 32|tr -d '='
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue