[PATCH 25/47] Syntax fixes for the new pyparted.

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

 



To get a parted.Device object, we call:
    parted.getDevice(path)

To create a new parted.Disk object, we need a parted.Device and
we call:
    parted.Disk(device=parted.Device)
---
 isys/isys.py   |    2 +-
 partedUtils.py |    1 +
 raid.py        |    6 +++---
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/isys/isys.py b/isys/isys.py
index 5894617..e6c4b34 100755
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -462,7 +462,7 @@ def driveDict(klassArg):
                         continue
 
                 if device.startswith("sd"):
-                    peddev = parted.PedDevice.get(dev['device'])
+                    peddev = parted.getDevice(dev['device'])
                     model = peddev.model
 
                     # blacklist *STMF on power5 iSeries boxes
diff --git a/partedUtils.py b/partedUtils.py
index f161d25..0f3162b 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -21,6 +21,7 @@
 #            Jeremy Katz <katzj@xxxxxxxxxx>
 #            Mike Fulbright <msf@xxxxxxxxxx>
 #            Karsten Hopp <karsten@xxxxxxxxxx>
+#            David Cantrell <dcantrell@xxxxxxxxxx>
 #
 
 """Helper functions for use when dealing with parted objects."""
diff --git a/raid.py b/raid.py
index 5eb7cb9..c0f2e69 100644
--- a/raid.py
+++ b/raid.py
@@ -66,15 +66,15 @@ def scanForRaid(drives):
     drives is a list of device names.
     Returns a list of (mdMinor, devices, level, totalDisks) tuples.
     """
-    
+
     raidSets = {}
     raidDevices = {}
 
     for d in drives:
         parts = []
         try:
-            dev = parted.PedDevice.get("/dev/%s" % (d,))
-            disk = parted.PedDisk.new(dev)
+            dev = parted.getDevice("/dev/%s" % (d,))
+            disk = parted.Disk(device=dev)
 
             raidParts = disk.getRaidPartitions()
             for part in raidParts:
-- 
1.6.1.3

_______________________________________________
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