[PATCH 06/13] Cleanups to restore things after the merge of master onto newui.
David Lehman
dlehman at redhat.com
Fri Jun 29 14:13:59 UTC 2012
---
pyanaconda/bootloader.py | 25 ++++---------------------
pyanaconda/storage/__init__.py | 7 +++++--
pyanaconda/storage/devices.py | 16 ++++++----------
pyanaconda/ui/gui/spokes/storage.py | 2 +-
4 files changed, 16 insertions(+), 34 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 658edba..991c8de 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -980,8 +980,8 @@ class GRUB(BootLoader):
packages = ["grub"]
- def __init__(self, storage):
- super(GRUB, self).__init__(storage)
+ def __init__(self, platform=None):
+ super(GRUB, self).__init__(platform=platform)
self.encrypted_password = ""
#
@@ -1357,8 +1357,8 @@ class GRUB2(GRUB):
stage2_raid_levels = [mdraid.RAID0, mdraid.RAID1, mdraid.RAID4,
mdraid.RAID5, mdraid.RAID6, mdraid.RAID10]
- def __init__(self, storage):
- super(GRUB2, self).__init__(storage)
+ def __init__(self, platform=None):
+ super(GRUB2, self).__init__(platform=platform)
self.boot_args.add("$([ -x /usr/sbin/rhcrashkernel-param ] && "\
"/usr/sbin/rhcrashkernel-param || :)")
@@ -1708,9 +1708,6 @@ class Yaboot(YabootSILOBase):
stage2_device_types = ["partition", "mdarray"]
stage2_device_raid_levels = [mdraid.RAID1]
- def __init__(self, storage):
- BootLoader.__init__(self, storage)
-
#
# configuration
#
@@ -2000,20 +1997,6 @@ class ZIPL(BootLoader):
buf = iutil.execWithCapture("zipl", [],
stderr="/dev/tty5",
root=ROOT_PATH)
- for line in buf.splitlines():
- if line.startswith("Preparing boot device: "):
- # Output here may look like:
- # Preparing boot device: dasdb (0200).
- # Preparing boot device: dasdl.
- # We want to extract the device name and pass that.
- name = re.sub(".+?: ", "", line)
- name = re.sub("(\s\(.+\))?\.$", "", name)
- device = self.storage.devicetree.getDeviceByName(name)
- if not device:
- raise BootLoaderError("could not find IPL device")
-
- self.stage1_device = device
-
class SILO(YabootSILOBase):
name = "SILO"
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 195ebef..be795b3 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -1021,8 +1021,11 @@ class Storage(object):
# set up the volume label, using hostname if necessary
if not name:
hostname = ""
- if hasattr(self.anaconda, "network"):
- hostname = self.anaconda.network.hostname
+ if self.data:
+ for nd in self.data.network.dataList():
+ if nd.hostname:
+ hostname = nd.hostname
+ break
name = self.suggestContainerName(prefix="btrfs",
hostname=hostname)
diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 9c69dfb..1e22138 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -3909,9 +3909,6 @@ class BTRFSDevice(StorageDevice):
self.sysfsPath = self.parents[0].sysfsPath
log.debug("%s sysfsPath set to %s" % (self.name, self.sysfsPath))
- def _statusWindow(self, intf=None, title="", msg=""):
- return self._progressWindow(intf=intf, title=title, msg=msg)
-
def _postCreate(self):
super(BTRFSDevice, self)._postCreate()
self.format.exists = True
@@ -4066,24 +4063,23 @@ class BTRFSVolumeDevice(BTRFSDevice):
return subvols
- def createSubVolumes(self, intf=None):
+ def createSubVolumes(self):
self._do_temp_mount()
for name, subvol in self.subvolumes:
if subvol.exists:
continue
- subvolume.create(mountpoint=self._temp_dir_prefix, intf=intf)
+ subvolume.create(mountpoint=self._temp_dir_prefix)
self._undo_temp_mount()
def removeSubVolume(self, name):
raise NotImplementedError()
- def _create(self, w):
+ def _create(self):
log_method_call(self, self.name, status=self.status)
btrfs.create_volume(devices=[d.path for d in self.parents],
label=self.format.label,
data=self.dataLevel,
- metadata=self.metaDataLevel,
- progress=w)
+ metadata=self.metaDataLevel)
def _destroy(self):
log_method_call(self, self.name, status=self.status)
@@ -4110,14 +4106,14 @@ class BTRFSSubVolumeDevice(BTRFSDevice):
log_method_call(self, name=self.name, orig=orig, kids=self.kids)
self.volume.setup(orig=orig)
- def _create(self, w):
+ def _create(self):
log_method_call(self, self.name, status=self.status)
self.volume._do_temp_mount()
mountpoint = self.volume.format._mountpoint
if not mountpoint:
raise RuntimeError("btrfs subvol create requires mounted volume")
- btrfs.create_subvolume(mountpoint, self.name, progress=w)
+ btrfs.create_subvolume(mountpoint, self.name)
self.volume._undo_temp_mount()
def _destroy(self):
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 626634b..4e597a7 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -257,7 +257,7 @@ class StorageSpoke(NormalSpoke):
self.data.autopart.autopart = self.autopart
# no thanks, lvm
- self.data.autopart.lvm = False
+ self.data.autopart.type = AUTOPART_TYPE_PLAIN
if self.autopart:
self.clearPartType = CLEARPART_TYPE_ALL
--
1.7.7.6
More information about the anaconda-patches
mailing list