summaryrefslogtreecommitdiffstats
path: root/textw
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2009-02-24 11:23:40 -0600
committerDavid Lehman <dlehman@redhat.com>2009-02-24 11:23:40 -0600
commitf8b7f2be4ed499045bcd3df5d02a3c065bd2a4a3 (patch)
tree564378b9c40c2ed9fd0d7961d85325acdfb43a21 /textw
parent0184b44db1d50ca405f93695c02ed2f8921cdd16 (diff)
downloadanaconda-f8b7f2be4ed499045bcd3df5d02a3c065bd2a4a3.tar.gz
anaconda-f8b7f2be4ed499045bcd3df5d02a3c065bd2a4a3.tar.xz
anaconda-f8b7f2be4ed499045bcd3df5d02a3c065bd2a4a3.zip
Lots of little updates to make things use the new storage module.
exception.py: - Remove unused partedUtils import. - Collect things from storage, not partitions. gui.py: - exceptionDisks is in storage now, not diskset. installclasses/rhel.py: installclasses/fedora.py: - setDefaultPartitioning take storage arg, not partitions. iw/autopart_type.py: - Find things in storage, not partitions. iw/bootloader_main_gui.py: iw/osbootwidget.py: - Remove unused partedUtils import. - Find fsset in storage now. - Use storage, not diskset, for iterating over disks/partitions. iw/lvm_dialog_gui.py: - Fix several typos from the original storage update. iw/partition_gui.py: - Find unusedMDMembers in storage, not partitions. iw/partitionui_helpers_gui.py: - Use StorageDevice.minSize,maxSize for resize limits. - Update doUIRAIDLVMChecks to use new storage module. packages.py: - Use new storage module to list vgs for selinux hack. storage/__init__.py: - Fix FSSet.createSwapFile so it creates the file on the correct device. storage/iscsi.py: - Use new storage module to identify iscsi disks. textw/partition_text.py: textw/upgrade_text.py: - Initial update to use new storage module. yuminstall.py: - Use storage module to find space for upgrade transaction. - Use storage module to locate protected partitions to mount in doPreInstall.
Diffstat (limited to 'textw')
-rw-r--r--textw/partition_text.py37
-rw-r--r--textw/upgrade_text.py61
2 files changed, 44 insertions, 54 deletions
diff --git a/textw/partition_text.py b/textw/partition_text.py
index ded62f283..0419f8a38 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -27,13 +27,7 @@ import string
import copy
import network
import parted
-import partitions
-from partedUtils import *
from partIntfHelpers import *
-from partRequests import *
-from fsset import *
-from raid import availRaidLevels
-from autopart import *
from snack import *
from constants_text import *
from constants import *
@@ -73,7 +67,7 @@ class PartitionTypeWindow:
for (txt, val) in opts:
typebox.append(txt, val)
- typebox.setCurrent(anaconda.id.partitions.autoClearPartType)
+ typebox.setCurrent(anaconda.id.storage.clearPartType)
g.add(typebox, 0, 1, (0, 1, 0, 0))
@@ -97,13 +91,11 @@ class PartitionTypeWindow:
screen.pushHelpLine (_("<Space>,<+>,<-> selection | <F2> Add drive | <F12> next screen"))
# restore the drive list each time
- disks = anaconda.id.diskset.disks.keys()
- disks.sort()
- cleardrives = anaconda.id.partitions.autoClearPartDrives
+ disks = anaconda.id.storage.disks
+ cleardrives = anaconda.id.storage.clearPartDrives
for disk in disks:
- size = anaconda.id.diskset.disks[disk].device.getSize(unit="MB")
- model = anaconda.id.diskset.disks[disk].device.model
+ model = disk.partedDisk.device.model
if not cleardrives or len(cleardrives) < 1:
selected = 1
@@ -113,7 +105,7 @@ class PartitionTypeWindow:
else:
selected = 0
- sizestr = "%8.0f MB" % (size,)
+ sizestr = "%8.0f MB" % (disk.size,)
diskdesc = "%6s %s (%s)" % (disk, sizestr, model[:24],)
drivelist.append(diskdesc, selected = selected)
@@ -133,13 +125,13 @@ class PartitionTypeWindow:
if rc == "F2":
if self.addDriveDialog(screen) != INSTALL_BACK:
- partitions.partitionObjectsInitialize(anaconda)
+ anaconda.id.storage.reset()
continue
if res == TEXT_BACK_CHECK:
return INSTALL_BACK
- if anaconda.id.diskset.checkNoDisks():
+ if anaconda.id.storage.checkNoDisks():
continue
if len(sel) < 1:
@@ -147,8 +139,8 @@ class PartitionTypeWindow:
continue
anaconda.dispatch.skipStep("autopartitionexecute", skip = 0)
- anaconda.id.partitions.autoClearPartType = partmethod_ans
- anaconda.id.partitions.autoClearPartDrives = sel
+ anaconda.id.storage.clearPartType = partmethod_ans
+ anaconda.id.storage.clearPartDrives = sel
break
# ask to review autopartition layout - but only if it's not custom partitioning
@@ -159,7 +151,7 @@ class PartitionTypeWindow:
def addDriveDialog(self, screen):
newdrv = []
- import iscsi
+ from storage import iscsi
if iscsi.has_iscsi():
newdrv.append("Add iSCSI target")
if iutil.isS390():
@@ -204,7 +196,7 @@ class PartitionTypeWindow:
devnum = entries[0].strip()
wwpn = entries[1].strip()
fcplun = entries[2].strip()
- self.anaconda.id.zfcp.addFCP(devnum, wwpn, fcplun)
+ self.anaconda.id.storage.zfcp.addFCP(devnum, wwpn, fcplun)
return INSTALL_OK
@@ -255,8 +247,9 @@ class PartitionTypeWindow:
raise ValueError, msg
iname = entries[1].strip()
- if not self.anaconda.id.iscsi.initiatorSet:
- self.anaconda.id.iscsi.initiator = iname
- self.anaconda.id.iscsi.addTarget(ip, port, user, pw, user_in, pw_in)
+ if not self.anaconda.id.storage.iscsi.initiatorSet:
+ self.anaconda.id.storage.iscsi.initiator = iname
+ self.anaconda.id.storage.iscsi.addTarget(ip, port, user, pw,
+ user_in, pw_in)
return INSTALL_OK
diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py
index 34c08238d..65cbaeb38 100644
--- a/textw/upgrade_text.py
+++ b/textw/upgrade_text.py
@@ -22,7 +22,6 @@ import iutil
import upgrade
from constants_text import *
from snack import *
-from fsset import *
from flags import flags
from constants import *
@@ -32,7 +31,7 @@ _ = lambda x: gettext.ldgettext("anaconda", x)
class UpgradeMigrateFSWindow:
def __call__ (self, screen, anaconda):
- migent = anaconda.id.fsset.getMigratableEntries()
+ migent = anaconda.id.storage.fsset.getMigratableEntries()
g = GridFormHelp(screen, _("Migrate File Systems"), "upmigfs", 1, 4)
@@ -48,15 +47,17 @@ class UpgradeMigrateFSWindow:
g.add(tb, 0, 0, anchorLeft = 1, padding = (0, 0, 0, 1))
partlist = CheckboxTree(height=4, scroll=1)
- for entry in migent:
- if entry.fsystem.getName() != entry.origfsystem.getName():
- migrating = 1
+ for device in migent:
+ if not device.format.exists:
+ migrating = True
else:
- migrating = 0
+ migrating = False
- partlist.append("/dev/%s - %s - %s" % (entry.device.getDevice(),
- entry.origfsystem.getName(),
- entry.mountpoint), entry, migrating)
+ # FIXME: the fstype at least will be wrong here
+ partlist.append("%s - %s - %s" % (device.path,
+ device.format.type,
+ device.format.mountpoint),
+ device, migrating)
g.add(partlist, 0, 1, padding = (0, 0, 0, 1))
@@ -74,29 +75,26 @@ class UpgradeMigrateFSWindow:
return INSTALL_BACK
# reset
- for entry in migent:
- entry.setFormat(0)
- entry.setMigrate(0)
- entry.fsystem = entry.origfsystem
+ # XXX the way to do this is by scheduling and cancelling actions
+ #for entry in migent:
+ # entry.setFormat(0)
+ # entry.setMigrate(0)
+ # entry.fsystem = entry.origfsystem
for entry in partlist.getSelection():
try:
- newfs = entry.fsystem.migratetofs[0]
- newfs = fileSystemTypeGet(newfs)
+ newfs = getFormat(entry.format.migratetofs[0])
except Exception, e:
log.info("failed to get new filesystem type, defaulting to ext3: %s" %(e,))
- newfs = fileSystemTypeGet("ext3")
- entry.setFileSystemType(newfs)
- entry.setFormat(0)
- entry.setMigrate(1)
-
+ newfs = getFormat("ext3")
+ anaconda.id.storage.migrateFormat(entry, newfs)
screen.popWindow()
return INSTALL_OK
class UpgradeSwapWindow:
def __call__ (self, screen, anaconda):
- (fsList, suggSize, suggMntPoint) = anaconda.id.upgradeSwapInfo
+ (fsList, suggSize, suggDev) = anaconda.id.upgradeSwapInfo
ramDetected = iutil.memInstalled()/1024
@@ -121,10 +119,13 @@ class UpgradeSwapWindow:
_("Partition"), _("Free Space")))
count = 0
- for (mnt, part, size) in fsList:
- listbox.append("%-25s /dev/%-10s %6dMB" % (mnt, part, size), count)
+ for (device, size) in fsList:
+ listbox.append("%-25s %-15s %6dMB" % (device.format.mountpoint,
+ device.path,
+ size),
+ count)
- if (mnt == suggMntPoint):
+ if (device == suggDev):
listbox.setCurrent(count)
count = count + 1
@@ -176,7 +177,7 @@ class UpgradeSwapWindow:
"valid number."))
if type(val) == type(1):
- (mnt, part, size) = fsList[listbox.current()]
+ (dev, size) = fsList[listbox.current()]
if size < (val + 16):
anaconda.intf.messageWindow(_("Error"),
_("There is not enough space on the "
@@ -189,7 +190,7 @@ class UpgradeSwapWindow:
else:
screen.popWindow()
if flags.setupFilesystems:
- upgrade.createSwapFile(anaconda.rootPath, anaconda.id.fsset, mnt, val)
+ upgrade.createSwapFile(anaconda.rootPath, dev, val)
anaconda.dispatch.skipStep("addswap", 1)
return INSTALL_OK
@@ -212,12 +213,8 @@ class UpgradeExamineWindow:
else:
default = 0
- for (drive, fs, desc, label, uuid) in parts:
- if drive[:5] != "/dev/":
- devname = "/dev/" + drive
- else:
- devname = drive
- partList.append("%s (%s)" %(desc, drive))
+ for (device, desc) in parts:
+ partList.append("%s (%s)" %(desc, device.path))
(button, choice) = ListboxChoiceWindow(screen, _("System to Upgrade"),
_("There seem to be one or more existing Linux installations "