--- pyanaconda/bootloader.py | 88 ++++++++++++++++++------------------ pyanaconda/kickstart.py | 2 +- pyanaconda/storage/__init__.py | 6 +- pyanaconda/storage/partitioning.py | 2 +- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py index ecc9eba..17c1d08 100644 --- a/pyanaconda/bootloader.py +++ b/pyanaconda/bootloader.py @@ -217,8 +217,8 @@ class BootLoader(object): self.boot_args = Arguments() self.dracut_args = Arguments() - self.drives = [] - self._drive_order = [] + self.disks = [] + self._disk_order = [] # timeout in seconds self._timeout = None @@ -239,8 +239,8 @@ class BootLoader(object): # the device the bootloader will be installed on self.stage1_device = None - # the "boot drive", meaning the drive stage1 _will_ go on - self.stage1_drive = None + # the "boot disk", meaning the disk stage1 _will_ go on + self.stage1_disk = None self._update_only = False self.skip_bootloader = False @@ -251,36 +251,36 @@ class BootLoader(object): self.warnings = [] # - # drive list access + # disk list access # # pylint: disable-msg=E0202 @property - def drive_order(self): - """Potentially partial order for drives.""" - return self._drive_order + def disk_order(self): + """Potentially partial order for disks.""" + return self._disk_order # pylint: disable-msg=E0102,E0202,E1101 - @drive_order.setter - def drive_order(self, order): - log.debug("new drive order: %s" % order) - self._drive_order = order - if self.drives: - self._sort_drives() - - def _sort_drives(self): - """Sort the internal drive list. """ - for name in reversed(self.drive_order): + @disk_order.setter + def disk_order(self, order): + log.debug("new disk order: %s" % order) + self._disk_order = order + if self.disks: + self._sort_disks() + + def _sort_disks(self): + """Sort the internal disk list. """ + for name in reversed(self.disk_order): try: - idx = [d.name for d in self.drives].index(name) + idx = [d.name for d in self.disks].index(name) except ValueError: - log.error("bios order specified unknown drive %s" % name) + log.error("bios order specified unknown disk %s" % name) continue - self.drives.insert(0, self.drives.pop(idx)) + self.disks.insert(0, self.disks.pop(idx)) - def set_drive_list(self, drives): - self.drives = drives[:] - self._sort_drives() + def set_disk_list(self, disks): + self.disks = disks[:] + self._sort_disks() # # image list access @@ -570,8 +570,8 @@ class BootLoader(object): return valid def set_stage1_device(self, devices): - if not self.stage1_drive: - raise BootLoaderError("need stage1 drive to set stage1 device") + if not self.stage1_disk: + raise BootLoaderError("need stage1 disk to set stage1 device") if self.stage2_is_preferred_stage1: self.stage1_device = self.stage2_device @@ -579,7 +579,7 @@ class BootLoader(object): self.stage1_device = None for device in devices: - if self.stage1_drive not in device.disks: + if self.stage1_disk not in device.disks: continue if self.is_valid_stage1_device(device): @@ -873,8 +873,8 @@ class BootLoader(object): if not self.stage1_device: return - if self.drive_order: - f.write(" --driveorder=%s" % ",".join(self.drive_order)) + if self.disk_order: + f.write(" --driveorder=%s" % ",".join(self.disk_order)) append = self.boot_args - self.dracut_args if append: @@ -945,8 +945,8 @@ class GRUB(BootLoader): def grub_device_name(self, device): """ Return a grub-friendly representation of device. """ - drive = getattr(device, "disk", device) - name = "(hd%d" % self.drives.index(drive) + disk = getattr(device, "disk", device) + name = "(hd%d" % self.disks.index(disk) if hasattr(device, "disk"): name += ",%d" % (device.partedPartition.number - 1,) name += ")" @@ -1134,9 +1134,9 @@ class GRUB(BootLoader): dev_map = open(map_path, "w") dev_map.write("# this device map was generated by anaconda\n") - for drive in self.drives: - dev_map.write("%s %s\n" % (self.grub_device_name(drive), - drive.path)) + for disk in self.disks: + dev_map.write("%s %s\n" % (self.grub_device_name(disk), + disk.path)) dev_map.close() def write_config_post(self): @@ -1417,16 +1417,16 @@ class GRUB2(GRUB): Disks and partitions use the (hdX,Y) notation, while lvm and md devices just use their names. """ - drive = None + disk = None name = "(%s)" % device.name if device.isDisk: - drive = device + disk = device elif hasattr(device, "disk"): - drive = device.disk + disk = device.disk - if drive is not None: - name = "(hd%d" % self.drives.index(drive) + if disk is not None: + name = "(hd%d" % self.disks.index(disk) if hasattr(device, "disk"): name += ",%d" % device.partedPartition.number name += ")" @@ -1449,16 +1449,16 @@ class GRUB2(GRUB): dev_map = open(map_path, "w") dev_map.write("# this device map was generated by anaconda\n") - devices = self.drives + devices = self.disks if self.stage1_device not in devices: devices.append(self.stage1_device) if self.stage2_device not in devices: devices.append(self.stage2_device) - for drive in devices: - dev_map.write("%s %s\n" % (self.grub_device_name(drive), - drive.path)) + for disk in devices: + dev_map.write("%s %s\n" % (self.grub_device_name(disk), + disk.path)) dev_map.close() def write_defaults(self): @@ -1550,7 +1550,7 @@ class GRUB2(GRUB): # def install(self): - # XXX will installing to multiple drives work as expected with GRUBv2? + # XXX will installing to multiple disks work as expected with GRUBv2? for (stage1dev, stage2dev) in self.install_targets: args = ["--no-floppy", self.grub_device_name(stage1dev)] if stage1dev == stage2dev: diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 229b67a..0c1e73e 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -297,7 +297,7 @@ class Bootloader(commands.bootloader.F15_Bootloader): log.warning("requested drive %s in boot drive order doesn't exist" % drive) self.driveorder.remove(drive) - self.anaconda.bootloader.drive_order = self.driveorder + self.anaconda.bootloader.disk_order = self.driveorder self.anaconda.dispatch.skip_steps("upgbootloader", "bootloader") diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py index 6a87789..ad6d4ce 100644 --- a/pyanaconda/storage/__init__.py +++ b/pyanaconda/storage/__init__.py @@ -447,8 +447,8 @@ class Storage(object): # no longer in the tree boot_disks = [d for d in self.disks if d.partitioned] boot_disks.sort(cmp=self.compareDisks, key=lambda d: d.name) - self.bootloader.set_drive_list(boot_disks) - self.bootloader.stage1_drive = None + self.bootloader.set_disk_list(boot_disks) + self.bootloader.stage1_disk = None self.bootloader.stage1_device = None self.bootloader.stage2_device = None @@ -1297,7 +1297,7 @@ class Storage(object): log.warning("either ksdata or bootloader data missing") return - self.bootloader.stage1_drive = self.data.bootDrive + self.bootloader.stage1_disk = self.data.bootloader.bootDrive self.bootloader.stage2_device = self.bootDevice self.bootloader.set_stage1_device(self.devices) diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py index 26b9e25..f9b7d8e 100644 --- a/pyanaconda/storage/partitioning.py +++ b/pyanaconda/storage/partitioning.py @@ -108,7 +108,7 @@ def _schedulePartitions(storage, disks): # stage1 device we might allocate already exists on the boot disk. stage1_device = None for device in storage.devices: - if storage.bootloader.stage1_drive not in device.disks: + if storage.bootloader.stage1_disk not in device.disks: continue if storage.bootloader._is_valid_stage1_device(device): -- 1.7.8.4 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list