Some fixes for anaconda-storage-branch. A few of these patches are from clumens because I picked them up from his patch collection for booty.
My testing/debugging work on the new storage code: http://dcantrel.fedorapeople.org/anaconda/storage/
--- iw/lvm_dialog_gui.py | 4 ++-- iw/partition_dialog_gui.py | 6 +++--- iw/raid_dialog_gui.py | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py index ea6d7e8..f8c4486 100644 --- a/iw/lvm_dialog_gui.py +++ b/iw/lvm_dialog_gui.py @@ -29,7 +29,7 @@ import datacombo import gui from partition_ui_helpers_gui import * from constants import * -import lvm +from storage.devicelibs import lvm
import gettext _ = lambda x: gettext.ldgettext("anaconda", x) @@ -671,7 +671,7 @@ class VolumeGroupEditor:
if format: actions.append(ActionDestroyFormat(usedev)) - actions.append(ActionCreateFormat(usedev, format) + actions.append(ActionCreateFormat(usedev, format)) if luksdev: actions.append(ActionCreateDevice(luksdev))
diff --git a/iw/partition_dialog_gui.py b/iw/partition_dialog_gui.py index 272b8bd..2fdf856 100644 --- a/iw/partition_dialog_gui.py +++ b/iw/partition_dialog_gui.py @@ -202,7 +202,7 @@ class PartitionEditor: luksdev = LUKSDevice("luks%d" % self.storage.nextID, format=format, parents=request) - actions.append(ActionCreateDevice(luksdev) + actions.append(ActionCreateDevice(luksdev)) format = getFormat("luks", device=self.origrequest.path, passphrase=self.storage.encryptionPassphrase) @@ -217,7 +217,7 @@ class PartitionEditor: if self.fsoptionsDict.has_key("resizecb") and \ self.fsoptionsDict["resizecb"].get_active(): size = self.fsoptionsDict["resizesb"].get_value_as_int() - actions.append(ActionResizeDevice(request, size) + actions.append(ActionResizeDevice(request, size)) if request.format.type != "none": actions.append(ActionResizeFormat(request, size))
@@ -229,7 +229,7 @@ class PartitionEditor:
if request.format.exists and \ getattr(request, "mountpoint", None) and \ - self.storage.formatByDefault(request)): + self.storage.formatByDefault(request): if not queryNoFormatPreExisting(self.intf): continue
diff --git a/iw/raid_dialog_gui.py b/iw/raid_dialog_gui.py index 8b6ed5e..e8f7e9f 100644 --- a/iw/raid_dialog_gui.py +++ b/iw/raid_dialog_gui.py @@ -28,7 +28,7 @@ import gtk import datacombo
import gui -from raid import availRaidLevels +from storage.devicelibs import mdraid from partition_ui_helpers_gui import * from constants import *
@@ -176,7 +176,7 @@ class RaidEditor: self.fsoptionsDict["lukscb"].get_active() and \ self.origrequest.format.type != "luks": luksdev = LUKSDevice("luks-%s" % request.name, - format=format + format=format, parents=self.origrequest) format = getFormat("luks", passphrase=self.storage.encryptionPassphrase) @@ -263,7 +263,7 @@ class RaidEditor: else: if origrequest.minor is not None: tstr = _("Edit RAID Device: %s") % (origrequest.path,) - except: + else: tstr = _("Edit RAID Device") dialog = gtk.Dialog(tstr, self.parent) @@ -377,7 +377,7 @@ class RaidEditor:
if not origrequest.exists: - self.levelcombo = self.createRaidLevelMenu(availRaidLevels, + self.levelcombo = self.createRaidLevelMenu(raid_levels, origrequest.level) lbl.set_mnemonic_widget(self.levelcombo) else:
--- kickstart.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/kickstart.py b/kickstart.py index bc8028a..ecc8cbc 100644 --- a/kickstart.py +++ b/kickstart.py @@ -26,14 +26,13 @@ import tempfile from flags import flags from constants import * import sys -import raid import string import urlgrabber.grabber as grabber -import lvm +from storage.devicelibs import lvm import warnings import upgrade import pykickstart.commands as commands -import cryptodev +from storage.devicelibs import crypto import zonetab from pykickstart.constants import * from pykickstart.errors import *
On Fri, 2009-02-27 at 18:26 -1000, David Cantrell wrote:
kickstart.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/kickstart.py b/kickstart.py index bc8028a..ecc8cbc 100644 --- a/kickstart.py +++ b/kickstart.py @@ -26,14 +26,13 @@ import tempfile from flags import flags from constants import * import sys -import raid import string import urlgrabber.grabber as grabber -import lvm +from storage.devicelibs import lvm
I'm not sure if this is needed for name checking -- see below comment.
import warnings import upgrade import pykickstart.commands as commands -import cryptodev +from storage.devicelibs import crypto
You probably want from 'storage.devices import *' here instead. storage.devicelibs.crypto is the lower-level library functions that don't know anything about the class hierarchies.
Dave
import zonetab from pykickstart.constants import * from pykickstart.errors import *
David Lehman wrote:
On Fri, 2009-02-27 at 18:26 -1000, David Cantrell wrote:
kickstart.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/kickstart.py b/kickstart.py index bc8028a..ecc8cbc 100644 --- a/kickstart.py +++ b/kickstart.py @@ -26,14 +26,13 @@ import tempfile from flags import flags from constants import * import sys -import raid import string import urlgrabber.grabber as grabber -import lvm +from storage.devicelibs import lvm
I'm not sure if this is needed for name checking -- see below comment.
import warnings import upgrade import pykickstart.commands as commands -import cryptodev +from storage.devicelibs import crypto
You probably want from 'storage.devices import *' here instead. storage.devicelibs.crypto is the lower-level library functions that don't know anything about the class hierarchies.
Noted. I'll change around what I did for this file and post a new patch.
Same fix as on the master branch. Got tired of seeing the DeprecationWarning messages. --- storage/iscsi.py | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/storage/iscsi.py b/storage/iscsi.py index af06cfe..fff6ad1 100644 --- a/storage/iscsi.py +++ b/storage/iscsi.py @@ -29,7 +29,8 @@ from flags import flags import logging import shutil import time -import md5, random +import hashlib +import random import partedUtils log = logging.getLogger("anaconda")
@@ -104,7 +105,7 @@ def randomIname(): """Generate a random initiator name the same way as iscsi-iname"""
s = "iqn.1994-05.com.fedora:01." - m = md5.md5() + m = hashlib.md5() u = os.uname() for i in u: m.update(i)
info['LVM2_LV_SIZE'] may contain some entries that are shell variable syntax, so strip the variable name and equal sign when building the sizes list. --- storage/udev.py | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/storage/udev.py b/storage/udev.py index 4f83c2a..d0cf6fb 100644 --- a/storage/udev.py +++ b/storage/udev.py @@ -262,12 +262,17 @@ def udev_device_get_lv_uuids(info): def udev_device_get_lv_sizes(info): # lvm's decmial precision is not configurable, so we tell it to use # KB and convert to MB here + def _splitVar(var): + lst = var.split('=') + return lst[len(lst) - 1] + sizes = info['LVM2_LV_SIZE'] if not sizes: sizes = [] elif not isinstance(sizes, list): sizes = [sizes]
+ sizes = map(lambda s: _splitVar(s), sizes) return [float(s) / 1024 for s in sizes]
From: Chris Lumens clumens@redhat.com
Signed-off-by: David Cantrell dcantrell@redhat.com --- Makefile | 4 ++-- anaconda | 6 ------ anaconda.spec | 3 +-- runpychecker.sh | 4 ++-- scripts/upd-instroot | 3 +-- 5 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/Makefile b/Makefile index deacdef..eed63f6 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ VERSION := $(shell awk '/Version:/ { print $$2 }' anaconda.spec) RELEASE := $(shell awk '/Release:/ { print $$2 }' anaconda.spec) CVSROOT ?= ${CVSROOT:-$(shell cat CVS/Root 2>/dev/null)}
-SUBDIRS = isys loader po \ +SUBDIRS = isys loader po booty \ textw utils scripts bootdisk installclasses \ iw pixmaps command-stubs ui docs # fonts aren't on s390/s390x @@ -40,7 +40,7 @@ ifneq (,$(filter i386 x86_64,$(ARCH))) SUBDIRS += gptsync endif
-PYCHECKERPATH=isys:textw:iw:installclasses:/usr/lib/booty:/usr/share/system-config-date +PYCHECKERPATH=isys:textw:iw:installclasses:/usr/share/system-config-date PYCHECKEROPTS=-F pycheckrc-for-anaconda
CATALOGS = po/anaconda.pot diff --git a/anaconda b/anaconda index 6ded5db..4e328b8 100755 --- a/anaconda +++ b/anaconda @@ -352,12 +352,6 @@ def setupPythonPath(): sys.path.insert(1, '/usr/lib/anaconda/textw') sys.path.insert(2, '/usr/lib/anaconda/iw')
- if (os.path.exists('booty')): - sys.path.append('booty') - sys.path.append('booty/edd') - else: - sys.path.append('/usr/lib/booty') - sys.path.append('/usr/share/system-config-date')
def addPoPath(dir): diff --git a/anaconda.spec b/anaconda.spec index 6de4f6b..9a07e04 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -42,7 +42,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %define iscsiver 6.2.0.870-3
BuildRequires: audit-libs-devel -BuildRequires: booty BuildRequires: bzip2-devel BuildRequires: device-mapper-devel >= %{dmver} BuildRequires: e2fsprogs-devel >= %{e2fsver} @@ -83,7 +82,6 @@ Requires: policycoreutils Requires: rpm-python >= %{rpmpythonver} Requires: comps-extras Requires: rhpl >= %{rhplver} -Requires: booty Requires: parted >= %{partedver} Requires: pyparted >= %{pypartedver} Requires: yum >= %{yumver} @@ -144,6 +142,7 @@ Obsoletes: anaconda-images <= 10 Provides: anaconda-images = %{version}-%{release} Obsoletes: anaconda-runtime < %{version}-%{release} Provides: anaconda-runtime = %{version}-%{release} +Obsoletes: booty
%description The anaconda package contains the program which was used to install your diff --git a/runpychecker.sh b/runpychecker.sh index 2a330ef..0330174 100755 --- a/runpychecker.sh +++ b/runpychecker.sh @@ -37,7 +37,7 @@ if [ "`tail -c 1 pychecker-false-positives`" == "`echo`" ]; then exit 1 fi
-export PYTHONPATH="isys:textw:iw:installclasses:/usr/lib/booty:/usr/share/system-config-date" +export PYTHONPATH="isys:textw:iw:installclasses:/usr/share/system-config-date"
pychecker --only --limit 1000 \ --maxlines 500 --maxargs 20 --maxbranches 80 --maxlocals 60 --maxreturns 20 \ @@ -45,7 +45,7 @@ pychecker --only --limit 1000 \ --no-import --no-miximport --no-pkgimport --no-reimport \ --no-argsused --no-varargsused --no-override \ $NON_STRICT_OPTIONS \ - anaconda anaconda *.py textw/*.py iw/*.py installclasses/*.py isys/*.py | \ + anaconda anaconda *.py textw/*.py iw/*.py installclasses/*.py isys/*.py booty/*.py booty/*/*.py | \ egrep -v "`cat $FALSE_POSITIVES | tr '\n' '|'`" > pychecker-log
if [ -s pychecker-log ]; then diff --git a/scripts/upd-instroot b/scripts/upd-instroot index a26a523..b7dfca2 100755 --- a/scripts/upd-instroot +++ b/scripts/upd-instroot @@ -152,7 +152,7 @@ die () {
PACKAGES="GConf2 NetworkManager ORBit2 PolicyKit acl anaconda anaconda-yum-plugins at-spi atk attr audit-libs bash bitmap-fonts-cjk - booty btrfs-progs busybox-anaconda bzip2 bzip2-libs cairo cjkunifonts-uming + btrfs-progs busybox-anaconda bzip2 bzip2-libs cairo cjkunifonts-uming comps-extras coreutils cpio cracklib cracklib-dicts cracklib-python cryptsetup-luks db4 dbus dbus-python dejavu-sans-fonts dejavu-sans-mono-fonts device-mapper @@ -496,7 +496,6 @@ usr/lib/anaconda-runtime usr/lib/anaconda/installclasses usr/lib/anaconda/iw usr/lib/anaconda/textw -usr/lib/booty usr/lib/kernel-wrapper usr/lib/locale usr/lib/python?.?/site-packages/bugzilla*
From: Chris Lumens clumens@redhat.com
Signed-off-by: David Cantrell dcantrell@redhat.com --- bootloader.py | 2 +- iw/timezone_gui.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bootloader.py b/bootloader.py index a5e4a94..fe8c912 100644 --- a/bootloader.py +++ b/bootloader.py @@ -36,7 +36,7 @@ import logging log = logging.getLogger("anaconda")
import booty -import bootloaderInfo +from booty import bootloaderInfo
def bootloaderSetupChoices(anaconda): if anaconda.dir == DISPATCH_BACK: diff --git a/iw/timezone_gui.py b/iw/timezone_gui.py index 2b62909..27657a9 100644 --- a/iw/timezone_gui.py +++ b/iw/timezone_gui.py @@ -29,7 +29,7 @@ import sys
from timezone_map_gui import TimezoneMap, Enum from iw_gui import * -from bootloaderInfo import dosFilesystems +from booty.bootloaderInfo import dosFilesystems from bootloader import hasWindows
from constants import *
From: Chris Lumens clumens@redhat.com
Signed-off-by: David Cantrell dcantrell@redhat.com --- iw/autopart_type.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/iw/autopart_type.py b/iw/autopart_type.py index 0c8e6c9..a316279 100644 --- a/iw/autopart_type.py +++ b/iw/autopart_type.py @@ -389,7 +389,7 @@ class PartitionTypeWindow(InstallWindow): size, partedDisk.device.model) i = bootstore.append(None) bootstore[i] = (dispstr, partedDisk.device.path[5:]) - if disk.device.path[5:] == defaultBoot: + if disk.path[5:] == defaultBoot: self.bootcombo.set_active_iter(i)
if len(bootstore) <= 1:
diff --git a/iw/autopart_type.py b/iw/autopart_type.py index 0c8e6c9..a316279 100644 --- a/iw/autopart_type.py +++ b/iw/autopart_type.py @@ -389,7 +389,7 @@ class PartitionTypeWindow(InstallWindow): size, partedDisk.device.model) i = bootstore.append(None) bootstore[i] = (dispstr, partedDisk.device.path[5:])
if disk.device.path[5:] == defaultBoot:
if disk.path[5:] == defaultBoot:
For this we have disk.name -- we should never have to do this slicing anymore.
self.bootcombo.set_active_iter(i) if len(bootstore) <= 1:
David Lehman wrote:
diff --git a/iw/autopart_type.py b/iw/autopart_type.py index 0c8e6c9..a316279 100644 --- a/iw/autopart_type.py +++ b/iw/autopart_type.py @@ -389,7 +389,7 @@ class PartitionTypeWindow(InstallWindow): size, partedDisk.device.model) i = bootstore.append(None) bootstore[i] = (dispstr, partedDisk.device.path[5:])
if disk.device.path[5:] == defaultBoot:
if disk.path[5:] == defaultBoot:
For this we have disk.name -- we should never have to do this slicing anymore.
Excellent. I'll change that and post a new patch, unless it's already been done.
From: Chris Lumens clumens@redhat.com
Signed-off-by: David Cantrell dcantrell@redhat.com --- bootloader.py | 4 ---- instdata.py | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/bootloader.py b/bootloader.py index fe8c912..00cd0e8 100644 --- a/bootloader.py +++ b/bootloader.py @@ -204,10 +204,6 @@ def writeBootloader(anaconda):
dosync()
-# return instance of the appropriate bootloader for our arch -def getBootloader(): - return booty.getBootloader() - def hasWindows(bl): foundWindows = False for (k,v) in bl.images.getImages().iteritems(): diff --git a/instdata.py b/instdata.py index c0aaf92..1ae61bf 100644 --- a/instdata.py +++ b/instdata.py @@ -30,7 +30,7 @@ import firewall import security import timezone import desktop -import bootloader +import booty import storage import urllib import iutil @@ -75,7 +75,7 @@ class InstallData: if flags.cmdline.has_key("preupgrade"): self.upgrade = True self.storage = storage.Storage(self.anaconda) - self.bootloader = bootloader.getBootloader() + self.bootloader = booty.getBootloader(self.storage) self.upgradeRoot = None self.rootParts = None self.upgradeSwapInfo = None
part is a PartitionDevice, which has a member named 'format' which is a DeviceFormat member. The minSize and maxSize properties are on the DeviceFormat member. --- iw/autopart_type.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/iw/autopart_type.py b/iw/autopart_type.py index a316279..993e4a2 100644 --- a/iw/autopart_type.py +++ b/iw/autopart_type.py @@ -48,8 +48,8 @@ def whichToResize(storage, intf): value = part.targetSize else: value = part.size - reqlower = part.minSize - requpper = part.maxSize + reqlower = part.format.minSize + requpper = part.format.maxSize
adj = resizeSB.get_adjustment() adj.lower = reqlower
On Fri, 2009-02-27 at 18:26 -1000, David Cantrell wrote:
part is a PartitionDevice, which has a member named 'format' which is a DeviceFormat member. The minSize and maxSize properties are on the DeviceFormat member.
I think what is needed is a minSize and maxSize attr on PartitionDevice (or StorageDevice) that take into account both the limitations of the device the partition is on and the format it contains.
iw/autopart_type.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/iw/autopart_type.py b/iw/autopart_type.py index a316279..993e4a2 100644 --- a/iw/autopart_type.py +++ b/iw/autopart_type.py @@ -48,8 +48,8 @@ def whichToResize(storage, intf): value = part.targetSize else: value = part.size
reqlower = part.minSize
requpper = part.maxSize
reqlower = part.format.minSize
requpper = part.format.maxSize adj = resizeSB.get_adjustment() adj.lower = reqlower
David Lehman wrote:
On Fri, 2009-02-27 at 18:26 -1000, David Cantrell wrote:
part is a PartitionDevice, which has a member named 'format' which is a DeviceFormat member. The minSize and maxSize properties are on the DeviceFormat member.
I think what is needed is a minSize and maxSize attr on PartitionDevice (or StorageDevice) that take into account both the limitations of the device the partition is on and the format it contains.
Probably so, at least for maxSize. I'll modify my patch and post it.
iw/autopart_type.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/iw/autopart_type.py b/iw/autopart_type.py index a316279..993e4a2 100644 --- a/iw/autopart_type.py +++ b/iw/autopart_type.py @@ -48,8 +48,8 @@ def whichToResize(storage, intf): value = part.targetSize else: value = part.size
reqlower = part.minSize
requpper = part.maxSize
reqlower = part.format.minSize
requpper = part.format.maxSize adj = resizeSB.get_adjustment() adj.lower = reqlower
Anaconda-devel-list mailing list Anaconda-devel-list@redhat.com https://www.redhat.com/mailman/listinfo/anaconda-devel-list
anaconda-devel@lists.stg.fedoraproject.org