[PATCH 02/11] Device class does not have a path member

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

 



The generic createParents() method in the Device class reference path, but
path is not a member of Device (only of StorageDevice and derived classes).

This error was caught by pylint and chances are we will never hit it, still
it is better to fix it.

While at it also report which parent exaclt does not exist in the
exception message.
---
 storage/devices.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index d11fce5..2be684f 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -298,7 +298,9 @@ class Device(object):
         log.info("NOTE: recursive device creation disabled")
         for parent in self.parents:
             if not parent.exists:
-                raise DeviceError("parent device does not exist", self.path)
+                raise DeviceError("parent device %s does not exist" %
+                                  getattr(parent, "path", None),
+                                  getattr(self, "path", None))
             #parent.create()
 
     def dependsOn(self, dep):
-- 
1.6.4

_______________________________________________
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