Browse Source

clean up dispatches over GLUSTERFS_MANILA_DRIVER_TYPE and os release

Change-Id: Ib8664c5aa71ff4efb64fd95262295fcf322e5a4e
Csaba Henk 2 years ago
parent
commit
1d46d65cf3
5 changed files with 31 additions and 17 deletions
  1. 1
    1
      README.md
  2. 16
    9
      devstack/gluster-functions.sh
  3. 1
    1
      devstack/settings
  4. 10
    4
      manila/post_test_hook.sh
  5. 3
    2
      manila/pre_test_hook.sh

+ 1
- 1
README.md View File

@@ -35,6 +35,6 @@ As part of "unstack.sh":
35 35
 * To enable Gluster as a backend for Manila:
36 36
      CONFIGURE_GLUSTERFS_MANILA=True
37 37
   Also select specific gluster backend type for manila, default is "glusterfs":
38
-     GLUSTERFS_MANILA_DRIVER_TYPE=[glusterfs OR glusterfs-native]
38
+     GLUSTERFS_MANILA_DRIVER_TYPE=[glusterfs-nfs OR glusterfs-native]
39 39
 
40 40
 * Then run "stack.sh"

+ 16
- 9
devstack/gluster-functions.sh View File

@@ -11,11 +11,11 @@ function install_glusterfs {
11 11
     elif is_ubuntu; then
12 12
         sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 3FE869A9
13 13
         if [ "$1" == "3.6" ]; then
14
-            echo "deb http://ppa.launchpad.net/gluster/glusterfs-3.6/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/glusterfs-3_6-trusty.list
15
-            echo "deb-src http://ppa.launchpad.net/gluster/glusterfs-3.6/ubuntu trusty main" | sudo tee --append /etc/apt/sources.list.d/glusterfs-3_6-trusty.list
14
+            echo "deb http://ppa.launchpad.net/gluster/glusterfs-3.6/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/glusterfs-3_6.list
15
+            echo "deb-src http://ppa.launchpad.net/gluster/glusterfs-3.6/ubuntu $(lsb_release -sc) main" | sudo tee --append /etc/apt/sources.list.d/glusterfs-3_6.list
16 16
         elif [ "$1" == "3.7" ]; then
17
-            echo "deb http://ppa.launchpad.net/gluster/glusterfs-3.7/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/glusterfs-3_7-trusty.list
18
-            echo "deb-src http://ppa.launchpad.net/gluster/glusterfs-3.7/ubuntu trusty main" | sudo tee --append /etc/apt/sources.list.d/glusterfs-3_7-trusty.list
17
+            echo "deb http://ppa.launchpad.net/gluster/glusterfs-3.7/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/glusterfs-3_7.list
18
+            echo "deb-src http://ppa.launchpad.net/gluster/glusterfs-3.7/ubuntu $(lsb_release -sc) main" | sudo tee --append /etc/apt/sources.list.d/glusterfs-3_7.list
19 19
         fi
20 20
         NO_UPDATE_REPOS=False
21 21
         REPOS_UPDATED=False
@@ -381,11 +381,18 @@ function _configure_manila_glusterfs_heketi {
381 381
 
382 382
 # Configure GlusterFS as a backend for Manila
383 383
 function configure_manila_backend_glusterfs {
384
-    if [[ "${GLUSTERFS_MANILA_DRIVER_TYPE}" == "glusterfs-heketi" ]]; then
385
-        _configure_manila_glusterfs_heketi
386
-    elif [[ "${GLUSTERFS_MANILA_DRIVER_TYPE}" == "glusterfs" ]]; then
384
+    case "$GLUSTERFS_MANILA_DRIVER_TYPE" in
385
+    glusterfs|glusterfs-nfs)
387 386
         _configure_manila_glusterfs_nfs
388
-    else
387
+        ;;
388
+    glusterfs-heketi|glusterfs-nfs-heketi)
389
+        _configure_manila_glusterfs_heketi
390
+        ;;
391
+    glusterfs-native)
389 392
         _configure_manila_glusterfs_native
390
-    fi
393
+        ;;
394
+    *)
395
+        echo "no configuration hook for GLUSTERFS_MANILA_DRIVER_TYPE=${GLUSTERFS_MANILA_DRIVER_TYPE}"
396
+        ;;
397
+    esac
391 398
 }

+ 1
- 1
devstack/settings View File

@@ -87,7 +87,7 @@ fi
87 87
 CONFIGURE_GLUSTERFS_MANILA=${CONFIGURE_GLUSTERFS_MANILA:-False}
88 88
 
89 89
 if [ "$CONFIGURE_GLUSTERFS_MANILA" == "True" ]; then
90
-    # Set GLUSTERFS_MANILA_DRIVER_TYPE to either 'glusterfs' or 'glusterfs-native'.
90
+    # Set GLUSTERFS_MANILA_DRIVER_TYPE to one of 'glusterfs-{nfs{,-heketi},native}.
91 91
     GLUSTERFS_MANILA_DRIVER_TYPE=${GLUSTERFS_MANILA_DRIVER_TYPE:-glusterfs}
92 92
 
93 93
     # Set GLUSTERFS_VG_NAME to the name of volume group.

+ 10
- 4
manila/post_test_hook.sh View File

@@ -40,11 +40,17 @@ if [[ "$GLUSTERFS_MANILA_DRIVER_TYPE" == "glusterfs-native" ]]; then
40 40
     # ro access_level is not supported by the driver.
41 41
     iniset $TEMPEST_CONFIG share enable_ro_access_level_for_protocols
42 42
 else
43
-    if [[ "$GLUSTERFS_MANILA_DRIVER_TYPE" == "glusterfs-heketi" ]]; then
44
-        local BACKEND_NAME="GLUSTERFSHEKETI"
45
-    else
43
+    case "$GLUSTERFS_MANILA_DRIVER_TYPE" in
44
+    glusterfs|glusterfs-nfs)
46 45
         local BACKEND_NAME="GLUSTERFS"
47
-    fi
46
+        ;;
47
+    glusterfs-heketi|glusterfs-nfs-heketi)
48
+        local BACKEND_NAME="GLUSTERFSHEKETI"
49
+        ;;
50
+    *)
51
+        echo "no BACKEND_NAME for GLUSTERFS_MANILA_DRIVER_TYPE=${GLUSTERFS_MANILA_DRIVER_TYPE}"
52
+        ;;
53
+    esac
48 54
     iniset $TEMPEST_CONFIG share enable_protocols nfs
49 55
     iniset $TEMPEST_CONFIG share enable_ip_rules_for_protocols nfs
50 56
     iniset $TEMPEST_CONFIG share storage_protocol NFS

+ 3
- 2
manila/pre_test_hook.sh View File

@@ -33,9 +33,10 @@ done
33 33
 # glusterfs (NFS) driver tests the directory based layout that doesn't support
34 34
 # snapshots. The job that tests glusterfs (NFS) driver has a name that
35 35
 # ends with "glusterfs".
36
-if [[ "$GLUSTERFS_MANILA_DRIVER_TYPE" == "glusterfs" ]]; then
36
+case "$GLUSTERFS_MANILA_DRIVER_TYPE" in
37
+glusterfs|glusterfs-nfs)
37 38
     echo "MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS='snapshot_support=False'" >> $localrc_path
38
-fi
39
+esac
39 40
 
40 41
 # Enabling isolated metadata in Neutron is required because
41 42
 # Tempest creates isolated networks and created vm's in scenario tests don't

Loading…
Cancel
Save