[blivet:master/rhel7 6/9] Use mdraid.new md_array_state() method to get state of md array (#1090009)

mulhern amulhern at redhat.com
Thu Dec 11 22:29:26 UTC 2014


Related: rhbz#1090009

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/devices/md.py | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/blivet/devices/md.py b/blivet/devices/md.py
index dcd0c54..e677060 100644
--- a/blivet/devices/md.py
+++ b/blivet/devices/md.py
@@ -370,16 +370,12 @@ class MDRaidArrayDevice(ContainerDevice, RaidDevice):
                 self.sysfsPath = ""
                 return status
 
-        state_file = "%s/md/array_state" % self.sysfsPath
-        try:
-            state = open(state_file).read().strip()
-            if state in ("clean", "active", "active-idle", "readonly", "read-auto"):
-                status = True
+        state = mdraid.md_array_state(self.sysfsPath)
+        if state in ("clean", "active", "active-idle", "readonly", "read-auto"):
+            status = True
             # mdcontainers have state inactive when started (clear if stopped)
-            if self.type == "mdcontainer" and state == "inactive":
-                status = True
-        except IOError:
-            status = False
+        if self.type == "mdcontainer" and state == "inactive":
+            status = True
 
         return status
 
-- 
1.9.3



More information about the anaconda-patches mailing list