From: Adriano Rosso <adriano.rosso@fit-tecnologia.org.br>
Date: Tue, 5 May 2015 18:58:38 +0000 (-0300)
Subject: HDS HNAS Driver fails when FS unhealthy
X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=dabbaeda979dd441fc8376a63ec6d5d232656eff;p=openstack-build%2Fcinder-build.git

HDS HNAS Driver fails when FS unhealthy

This patch fixes the error when there is a file system in an
unhealthy HNAS storage pool.

Change-Id: Ic17c540039996f4a1060829d5f1f12a5f3155271
Closes-bug: #1452002
(cherry picked from commit 418cf4b989c8df983c1109c8c8851d9d4c3ffbfe)
---

diff --git a/cinder/tests/test_hds_hnas_backend.py b/cinder/tests/test_hds_hnas_backend.py
index 8f2070a75..6af18bb92 100644
--- a/cinder/tests/test_hds_hnas_backend.py
+++ b/cinder/tests/test_hds_hnas_backend.py
@@ -102,6 +102,10 @@ HNAS_RESULT5 = "\n\
 1032         test    2  3.97 GB 2.12 GB (53%) 0 B (0%)   NA      \
    1.85 GB (47%)  No                                        4 KB,\
    WFS-2,128 DSBs\n\
+1058         huge_FS    7  1.50 TB  Not determined\n\
+1053              fs-unmounted    4   108 GB     Not mounted \
+   NA  943 MB (18%)  39.2 GB (36%)    No                    4 KB,\
+   WFS-2,128 DSBs,dedupe enabled\n\
 \n"
 
 HNAS_RESULT6 = "\n\
@@ -173,6 +177,10 @@ Deduped          Avail  Thin  ThinSize  ThinAvail              FS Type\n\
   No                       4 KB,WFS-2,128 DSBs\n\
 1047  manage_test02  19.9 GB  9.29 GB (47%)   0 B (0%)       NA  10.6 GB (53%)\
   No                       4 KB,WFS-2,128 DSBs\n\
+1058         huge_FS    7  1.50 TB  Not determined\n\
+1053              fs-unmounted    4   108 GB     Not mounted \
+   NA  943 MB (18%)  39.2 GB (36%)    No                 4 KB,\
+   WFS-2,128 DSBs,dedupe enabled\n\
 \n"
 
 HNAS_RESULT20 = "\n\
diff --git a/cinder/volume/drivers/hds/hnas_backend.py b/cinder/volume/drivers/hds/hnas_backend.py
index 64087d145..c449cd468 100644
--- a/cinder/volume/drivers/hds/hnas_backend.py
+++ b/cinder/volume/drivers/hds/hnas_backend.py
@@ -182,7 +182,7 @@ class HnasBackend(object):
 
         newout = ""
         for line in lines:
-            if 'Not mounted' in line:
+            if 'Not mounted' in line or 'Not determined' in line:
                 continue
             if 'not' not in line and 'EVS' in line:
                 single_evs = False