From 1413b01974f156dc51c45a72256dc609cf4163f3 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Tue, 29 Nov 2005 23:12:22 +0000 Subject: catch errors when unmounting --- lib/python/Components/Harddisk.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/python/Components/Harddisk.py') diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py index 0fc17d69..09864fc9 100644 --- a/lib/python/Components/Harddisk.py +++ b/lib/python/Components/Harddisk.py @@ -103,7 +103,8 @@ class Harddisk: def unmount(self): cmd = "/bin/umount " + self.devidex + "part*" - os.system(cmd) + res = os.system(cmd) + return (res >> 8) def createPartition(self): cmd = "/sbin/sfdisk -f " + self.devidex + "disc" @@ -127,7 +128,8 @@ class Harddisk: return (res >> 8) def initialize(self): - self.unmount() + if self.unmount() != 0: + return -5 if self.createPartition() != 0: return -1 -- cgit v1.2.3