3
# Configure the manila specific parts of shares; the type and other basic info.
10
# see if the type list has been set up
11
types=($(manila type-list | head -n -1 | tail -n +4 | awk '{print $4}'))
12
if ! elementIn "default_share_type" ${types[@]}; then
13
manila type-create default_share_type True
16
# get the share network - if not available then try to set it up.
17
share_networks=($(manila share-network-list | head -n -1 | tail -n +4 | awk '{print $4}'))
18
if ! elementIn "test_share_network" ${share_networks[@]}; then
19
# create the share network
20
net=$(openstack network list -c ID -c Name -c Subnets -f value | grep private)
21
net_id=$(echo $net | awk '{print $1}' | tr -d '\n')
22
subnet_id=$(echo $net | awk '{print $3}' | tr -d '\n')
23
manila share-network-create --name test_share_network \
24
--neutron-net-id $net_id \
25
--neutron-subnet-id $subnet_id
28
# now configure the rest of the manila config items to enable the generic
30
flavor_id=$(openstack flavor list -c ID -c Name -f value | grep manila-service-flavor | awk '{ print $1 }')
31
version=$(juju --version | head -c 1)
32
if [ "$version" == "1" ]; then
33
juju_command="manila-generic set"
34
elif [ "$version" == "2" ]; then
35
juju_command="config manila-generic"
37
echo "Can't work with version $version"
41
driver-service-instance-flavor-id=$flavor_id \
42
driver-handles-share-servers=true \
43
driver-service-instance-password=manila \
44
driver-auth-type=password
46
if [ "$version" == "1" ]; then
47
juju_command="manila set"
49
juju_command="config manila"
51
juju $juju_command default-share-backend=generic