From 2bd73dd2b669d33e204e773114edc79e21993dfe Mon Sep 17 00:00:00 2001
From: Ramana Raja <rraja@redhat.com>
Date: Tue, 22 Sep 2015 18:21:59 +0530
Subject: [PATCH] Manila: Fix share_type in glusterfs (NFS) CI

During glusterfs (NFS) CI run, the extra spec "snapshot_support" used
for the default share-type is set to "True" even though the CI tests
the glusterfs backend with directory based share layout scheme that
does not support snapshot. So set the extra_spec to False which would
allow the Manila scheduler to pick up the glusterfs backend as a valid
host.

Change-Id: I7357417774cd16a2c114abd48a7bdb65a9eefc51
Closes-Bug: #1498399
---
 manila/pre_test_hook.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/manila/pre_test_hook.sh b/manila/pre_test_hook.sh
index 210a365..c11c0c1 100755
--- a/manila/pre_test_hook.sh
+++ b/manila/pre_test_hook.sh
@@ -29,6 +29,15 @@ else
     echo "MANILA_MULTI_BACKEND=False" >> $localrc_path
 fi
 
+# If the job tests glusterfs (NFS) driver, then create default share_type with
+# extra_spec snapshot_support as False. Becasuse the job that tests the
+# glusterfs (NFS) driver tests the directory based layout that doesn't support
+# snapshots. The job that tests glusterfs (NFS) driver has a name that
+# ends with "glusterfs".
+if [[ $JOB_NAME =~ manila-tempest-dsvm-glusterfs$ ]]; then
+    echo "MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS='snapshot_support=False'" >> $localrc_path
+fi
+
 # Enabling isolated metadata in Neutron is required because
 # Tempest creates isolated networks and created vm's in scenario tests don't
 # have access to Nova Metadata service. This leads to unavailability of