- use get_partition_path_from_device() to get the path to the first
authorMark Huang <mlhuang@cs.princeton.edu>
Sat, 13 Jan 2007 20:43:37 +0000 (20:43 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Sat, 13 Jan 2007 20:43:37 +0000 (20:43 +0000)
  partition of a device (under devfs on 2.4, it's /part1, not
  /disc1!). This also checks for cciss device paths..

source/steps/CheckForNewDisks.py

index 0c121c3..45ddb69 100644 (file)
@@ -86,14 +86,11 @@ def Run( vars, log ):
                    "of the volume group.\n" % device )
 
         # this is the lvm partition, if it exists on that device
-        lvm_partition= "%s1" % device
-        cciss_lvm_partition= "%sp1" % device
-        cmd = "pvdisplay %s | grep -q 'planetlab'"
+        lvm_partition= InstallPartitionDisks.get_partition_path_from_device( device, vars, log )
+        cmd = "pvdisplay %s | grep -q 'planetlab'" % lvm_partition
+        already_added= utils.sysexec_noerr(cmd, log)
 
-        already_added= utils.sysexec_noerr(cmd % lvm_partition, log)
-        cciss_already_added= utils.sysexec_noerr(cmd % cciss_lvm_partition, log)
-
-        if already_added or cciss_already_added:
+        if already_added:
             log.write( "It appears %s is part of the volume group, continuing.\n" %
                        device )
             continue