[PATCH 3/4] Do not run wipefs if the device node does not exist (#693764)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 pyanaconda/storage/formats/__init__.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/storage/formats/__init__.py b/pyanaconda/storage/formats/__init__.py
index 9336c89..ce4fc8f 100644
--- a/pyanaconda/storage/formats/__init__.py
+++ b/pyanaconda/storage/formats/__init__.py
@@ -283,6 +283,11 @@ class DeviceFormat(object):
     def destroy(self, *args, **kwargs):
         log_method_call(self, device=self.device,
                         type=self.type, status=self.status)
+
+        if not os.path.exists(self.device):
+            self.exists = False
+            return
+
         try:
             rc = execWithRedirect("wipefs", ["-a", self.device],
                                   stderr="/dev/tty5",
@@ -415,6 +420,9 @@ class DeviceFormat(object):
             except DMError:
                 device = self.device
 
+            if not os.access(device, os.R_OK):
+                return None
+
             sysfs_path = get_sysfs_path_by_name(device)
             dev = udev_get_device(sysfs_path[4:])
 
-- 
1.7.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux