diff --git a/deployment_scripts/puppet/modules/manila_auxiliary/files/meta.sh b/deployment_scripts/puppet/modules/manila_auxiliary/files/meta.sh index 85ce8fb..9f67748 100755 --- a/deployment_scripts/puppet/modules/manila_auxiliary/files/meta.sh +++ b/deployment_scripts/puppet/modules/manila_auxiliary/files/meta.sh @@ -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 diff --git a/gen_password.sh b/gen_password.sh index 8830aa2..61ed8e9 100644 --- a/gen_password.sh +++ b/gen_password.sh @@ -2,7 +2,7 @@ CLUSTER_ID=$1 -function gen_pass { +gen_pass() { openssl rand -base64 32|tr -d '=' }