[PATCH 1/3] Do not try to stat FileDevice's path if it doesn't exist

Vratislav Podzimek vpodzime at redhat.com
Fri Apr 10 14:29:09 UTC 2015


As is the case for a losetup'ed and later removed.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 blivet/devices/file.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/blivet/devices/file.py b/blivet/devices/file.py
index 640d51d..a6524c5 100644
--- a/blivet/devices/file.py
+++ b/blivet/devices/file.py
@@ -83,7 +83,7 @@ class FileDevice(StorageDevice):
 
     def _getSize(self):
         size = self._size
-        if self.exists:
+        if self.exists and os.path.exists(self.path):
             st = os.stat(self.path)
             size = Size(st[stat.ST_SIZE])
 
-- 
2.1.0



More information about the anaconda-patches mailing list