[master 13/30] Add error identification for HFSPlusFSCK.

mulkieran installerbot-noreply at redhat.com
Tue Apr 14 15:32:30 UTC 2015


From: mulhern <amulhern at redhat.com>

Related: #12

Previously, HFSPlusFSCK always considered fsck operation to have succeeded.
Now it checkes for an error and behaves essentially like the other FSCK
tasks.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/tasks/fsck.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/blivet/tasks/fsck.py b/blivet/tasks/fsck.py
index 15062bc..c1576c5 100644
--- a/blivet/tasks/fsck.py
+++ b/blivet/tasks/fsck.py
@@ -160,12 +160,20 @@ def _errorMessage(self, rc):
         return "\n".join(msgs) or None
 
 class HFSPlusFSCK(FSCK):
+    _fsckErrors = {3: "Quick check found a dirty filesystem; no repairs done.",
+                   4: "Root filesystem was dirty. System should be rebooted.",
+                   8: "Corrupt filesystem, repairs did not succeed.",
+                   47: "Major error found; no repairs attempted."}
     app_name = "fsck.hfsplus"
     options = []
 
     def _errorMessage(self, rc):
-        # pylint: disable=unused-argument
-        return None
+        if rc < 1:
+            return None
+        try:
+            return self._fsckErrors[rc]
+        except KeyError:
+            return _UNKNOWN_RC_MSG % rc
 
 class NTFSFSCK(FSCK):
     app_name = "ntfsresize"


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/b129d442903436725659c4265a2c850eeddf5236


More information about the anaconda-patches mailing list