From 7ea42d120f84005dce27a9d3ca98732c929999ab Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Mon, 21 Dec 2009 13:10:13 -0500 Subject: Move storage into the Anaconda class. --- iw/advanced_storage.py | 18 +++++++++--------- iw/autopart_type.py | 2 +- iw/bootloader_main_gui.py | 8 ++++---- iw/cleardisks_gui.py | 24 ++++++++++++------------ iw/filter_gui.py | 12 ++++++------ iw/lvm_dialog_gui.py | 2 +- iw/osbootwidget.py | 2 +- iw/partition_dialog_gui.py | 4 ++-- iw/partition_gui.py | 6 +++--- iw/task_gui.py | 4 ++-- iw/upgrade_bootloader_gui.py | 2 +- iw/upgrade_migratefs_gui.py | 4 ++-- iw/upgrade_swap_gui.py | 2 +- 13 files changed, 45 insertions(+), 45 deletions(-) (limited to 'iw') diff --git a/iw/advanced_storage.py b/iw/advanced_storage.py index c6fbf5f3b..902d8ac4a 100644 --- a/iw/advanced_storage.py +++ b/iw/advanced_storage.py @@ -93,9 +93,9 @@ def addFcoeDrive(anaconda): continue try: - anaconda.id.storage.fcoe.addSan(store.get_value(iter, 1), - dcb=dcb_cb.get_active(), - intf=anaconda.intf) + anaconda.storage.fcoe.addSan(store.get_value(iter, 1), + dcb=dcb_cb.get_active(), + intf=anaconda.intf) except IOError as e: anaconda.intf.messageWindow(_("Error"), str(e)) rc = gtk.RESPONSE_CANCEL @@ -124,8 +124,8 @@ def addIscsiDrive(anaconda): # get the initiator name if it exists and don't allow changing # once set e = dxml.get_widget("iscsiInitiatorEntry") - e.set_text(anaconda.id.storage.iscsi.initiator) - if anaconda.id.storage.iscsi.initiatorSet: + e.set_text(anaconda.storage.iscsi.initiator) + if anaconda.storage.iscsi.initiatorSet: e.set_sensitive(False) while True: @@ -139,7 +139,7 @@ def addIscsiDrive(anaconda): _("You must provide an initiator name.")) continue - anaconda.id.storage.iscsi.initiator = initiator + anaconda.storage.iscsi.initiator = initiator target = dxml.get_widget("iscsiAddrEntry").get_text().strip() user = dxml.get_widget("userEntry").get_text().strip() @@ -169,9 +169,9 @@ def addIscsiDrive(anaconda): continue try: - anaconda.id.storage.iscsi.addTarget(ip, port, user, pw, - user_in, pw_in, - anaconda.intf) + anaconda.storage.iscsi.addTarget(ip, port, user, pw, + user_in, pw_in, + anaconda.intf) except ValueError as e: anaconda.intf.messageWindow(_("Error"), str(e)) continue diff --git a/iw/autopart_type.py b/iw/autopart_type.py index 9134e68a1..ca5c0c966 100644 --- a/iw/autopart_type.py +++ b/iw/autopart_type.py @@ -211,7 +211,7 @@ class PartitionTypeWindow(InstallWindow): def getScreen(self, anaconda): self.anaconda = anaconda - self.storage = anaconda.id.storage + self.storage = anaconda.storage self.intf = anaconda.intf self.dispatch = anaconda.dispatch diff --git a/iw/bootloader_main_gui.py b/iw/bootloader_main_gui.py index fa5d5543d..b2cde964c 100644 --- a/iw/bootloader_main_gui.py +++ b/iw/bootloader_main_gui.py @@ -134,8 +134,8 @@ class MainBootloaderWindow(InstallWindow): lbl = dxml.get_widget("bd%dLabel" %(i,)) combo.show() lbl.show() - partitioned = anaconda.id.storage.partitioned - disks = anaconda.id.storage.disks + partitioned = anaconda.storage.partitioned + disks = anaconda.storage.disks bl_disks = [d for d in disks if d in partitioned] m = __genStore(combo, bl_disks, self.driveorder[i - 1]) @@ -193,8 +193,8 @@ class MainBootloaderWindow(InstallWindow): self.driveorder = self.bl.drivelist if len(self.driveorder) == 0: - partitioned = anaconda.id.storage.partitioned - disks = anaconda.id.storage.disks + partitioned = anaconda.storage.partitioned + disks = anaconda.storage.disks self.driveorder = [d.name for d in disks if d in partitioned] if self.bl.getPassword(): diff --git a/iw/cleardisks_gui.py b/iw/cleardisks_gui.py index 23758999c..032555b12 100644 --- a/iw/cleardisks_gui.py +++ b/iw/cleardisks_gui.py @@ -58,17 +58,17 @@ class ClearDisksWindow (InstallWindow): bootDisk = selected[0][OBJECT_COL].name - cleardisks.sort(self.anaconda.id.storage.compareDisks) + cleardisks.sort(self.anaconda.storage.compareDisks) - self.anaconda.id.storage.clearPartDisks = cleardisks + self.anaconda.storage.clearPartDisks = cleardisks self.anaconda.id.bootloader.updateDriveList([bootDisk]) def getScreen (self, anaconda): # Skip this screen as well if we only had one disk available in the # filtering UI. - if len(anaconda.id.storage.exclusiveDisks) == 1: - anaconda.id.storage.clearPartDisks = anaconda.id.storage.exclusiveDisks - anaconda.id.bootloader.drivelist = anaconda.id.storage.exclusiveDisks + if len(anaconda.storage.exclusiveDisks) == 1: + anaconda.storage.clearPartDisks = anaconda.storage.exclusiveDisks + anaconda.id.bootloader.drivelist = anaconda.storage.exclusiveDisks return None (xml, self.vbox) = gui.getGladeWidget("cleardisks.glade", "vbox") @@ -135,19 +135,19 @@ class ClearDisksWindow (InstallWindow): # Store the first disk (according to our detected BIOS order) for # auto boot device selection - self.bootDisk = sorted(self.anaconda.id.storage.exclusiveDisks, - self.anaconda.id.storage.compareDisks)[0] + self.bootDisk = sorted(self.anaconda.storage.exclusiveDisks, + self.anaconda.storage.compareDisks)[0] # The device filtering UI set up exclusiveDisks as a list of the names # of all the disks we should use later on. Now we need to go get those, # look up some more information in the devicetree, and set up the # selector. - for d in self.anaconda.id.storage.exclusiveDisks: - device = self.anaconda.id.storage.devicetree.getDeviceByName(d) + for d in self.anaconda.storage.exclusiveDisks: + device = self.anaconda.storage.devicetree.getDeviceByName(d) if not device: continue - rightVisible = d in self.anaconda.id.storage.clearPartDisks + rightVisible = d in self.anaconda.storage.clearPartDisks rightActive = rightVisible and \ d in self.anaconda.id.bootloader.drivelist[:1] leftVisible = not rightVisible @@ -169,9 +169,9 @@ class ClearDisksWindow (InstallWindow): self.leftTreeView.get_selection().set_mode(gtk.SELECTION_MULTIPLE) self.rightTreeView.get_selection().set_mode(gtk.SELECTION_MULTIPLE) - if self.anaconda.id.storage.clearPartType == CLEARPART_TYPE_LINUX: + if self.anaconda.storage.clearPartType == CLEARPART_TYPE_LINUX: self.installTargetTip.set_markup(_("Tip: All Linux filesystems on install target devices will be reformatted and wiped of any data. Make sure you have backups.")) - elif self.anaconda.id.storage.clearPartType == CLEARPART_TYPE_ALL: + elif self.anaconda.storage.clearPartType == CLEARPART_TYPE_ALL: self.installTargetTip.set_markup(_("Tip: Install target devices will be reformatted and wiped of any data. Make sure you have backups.")) else: self.installTargetTip.set_markup(_("Tip: Your filesystems on install target devices will not be wiped unless you choose to do so during customization.")) diff --git a/iw/filter_gui.py b/iw/filter_gui.py index 67c642703..9901360c4 100644 --- a/iw/filter_gui.py +++ b/iw/filter_gui.py @@ -408,7 +408,7 @@ class FilterWindow(InstallWindow): custom_icon="error") raise gui.StayOnScreen - self.anaconda.id.storage.exclusiveDisks = list(selected) + self.anaconda.storage.exclusiveDisks = list(selected) def _add_advanced_clicked(self, button): from advanced_storage import addDrive @@ -555,7 +555,7 @@ class FilterWindow(InstallWindow): # cleardisks UI. Unfortunately, that means we need to duplicate # some of the getNext method. if len(singlepaths) == 1: - anaconda.id.storage.exclusiveDisks = [udev_device_get_name(singlepaths[0])] + anaconda.storage.exclusiveDisks = [udev_device_get_name(singlepaths[0])] return None self.pages = [self._makeBasic()] @@ -608,11 +608,11 @@ class FilterWindow(InstallWindow): totalSize += tuple[0]["XXX_SIZE"] def _active(name): - if self.anaconda.id.storage.exclusiveDisks and \ - name in self.anaconda.id.storage.exclusiveDisks: + if self.anaconda.storage.exclusiveDisks and \ + name in self.anaconda.storage.exclusiveDisks: return True - elif self.anaconda.id.storage.ignoredDisks and \ - name not in self.anaconda.id.storage.ignoredDisks: + elif self.anaconda.storage.ignoredDisks and \ + name not in self.anaconda.storage.ignoredDisks: return True else: return False diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py index 823a83629..7a98d9953 100644 --- a/iw/lvm_dialog_gui.py +++ b/iw/lvm_dialog_gui.py @@ -1165,7 +1165,7 @@ class VolumeGroupEditor: self.dialog = None def __init__(self, anaconda, intf, parent, vg, isNew = 0): - self.storage = anaconda.id.storage + self.storage = anaconda.storage # the vg instance we were passed self.vg = vg diff --git a/iw/osbootwidget.py b/iw/osbootwidget.py index fcde02721..d73786328 100644 --- a/iw/osbootwidget.py +++ b/iw/osbootwidget.py @@ -36,7 +36,7 @@ class OSBootWidget: def __init__(self, anaconda, parent, blname = None): self.bl = anaconda.id.bootloader - self.storage = anaconda.id.storage + self.storage = anaconda.storage self.parent = parent self.intf = anaconda.intf if blname is not None: diff --git a/iw/partition_dialog_gui.py b/iw/partition_dialog_gui.py index 7f76c8630..920ee22b7 100644 --- a/iw/partition_dialog_gui.py +++ b/iw/partition_dialog_gui.py @@ -239,7 +239,7 @@ class PartitionEditor: usedev = request origformat = usedev.format - devicetree = self.anaconda.id.storage.devicetree + devicetree = self.anaconda.storage.devicetree if self.fsoptionsDict.has_key("formatcb"): if self.fsoptionsDict["formatcb"].get_active(): @@ -337,7 +337,7 @@ class PartitionEditor: def __init__(self, anaconda, parent, origrequest, isNew = 0, restrictfs = None): self.anaconda = anaconda - self.storage = self.anaconda.id.storage + self.storage = self.anaconda.storage self.intf = self.anaconda.intf self.origrequest = origrequest self.isNew = isNew diff --git a/iw/partition_gui.py b/iw/partition_gui.py index 2e9be5ff6..588174135 100644 --- a/iw/partition_gui.py +++ b/iw/partition_gui.py @@ -1677,14 +1677,14 @@ class PartitionWindow(InstallWindow): for action in actions: # XXX we should handle exceptions here - self.anaconda.id.storage.devicetree.registerAction(action) + self.anaconda.storage.devicetree.registerAction(action) if self.refresh(justRedraw=not actions): # autopart failed -- cancel the actions and try to get # back to previous state actions.reverse() for action in actions: - self.anaconda.id.storage.devicetree.cancelAction(action) + self.anaconda.storage.devicetree.cancelAction(action) # FIXME: proper action/device management would be better if not isNew: @@ -1793,7 +1793,7 @@ class PartitionWindow(InstallWindow): def getScreen(self, anaconda): self.anaconda = anaconda - self.storage = anaconda.id.storage + self.storage = anaconda.storage self.intf = anaconda.intf self.checkmark_pixbuf = gui.getPixbuf("checkMark.png") self.lock_pixbuf = gui.getPixbuf("gnome-lock.png") diff --git a/iw/task_gui.py b/iw/task_gui.py index a02adcb8c..b5aa73bb2 100644 --- a/iw/task_gui.py +++ b/iw/task_gui.py @@ -275,7 +275,7 @@ class RepoEditor: def _applyMedia(self, repo): # FIXME works only if storage has detected format of cdrom drive ayum = self.anaconda.backend.ayum - cdr = scanForMedia(ayum.tree, self.anaconda.id.storage) + cdr = scanForMedia(ayum.tree, self.anaconda.storage) if not cdr: self.intf.messageWindow(_("No Media Found"), _("No installation media was found. " @@ -421,7 +421,7 @@ class RepoMethodstrEditor(RepoEditor): return repourl def _applyMedia(self): - cdr = scanForMedia(self.anaconda.backend.ayum.tree, self.anaconda.id.storage) + cdr = scanForMedia(self.anaconda.backend.ayum.tree, self.anaconda.storage) if not cdr: self.intf.messageWindow(_("No Media Found"), _("No installation media was found. " diff --git a/iw/upgrade_bootloader_gui.py b/iw/upgrade_bootloader_gui.py index 72e0ec297..5c96f4192 100644 --- a/iw/upgrade_bootloader_gui.py +++ b/iw/upgrade_bootloader_gui.py @@ -118,7 +118,7 @@ class UpgradeBootloaderWindow (InstallWindow): newToLibata = self._newToLibata(anaconda.rootPath) (self.type, self.bootDev) = \ - checkbootloader.getBootloaderTypeAndBoot(anaconda.rootPath, storage=anaconda.id.storage) + checkbootloader.getBootloaderTypeAndBoot(anaconda.rootPath, storage=anaconda.storage) self.update_radio = gtk.RadioButton(None, _("_Update boot loader configuration")) updatestr = _("This will update your current boot loader.") diff --git a/iw/upgrade_migratefs_gui.py b/iw/upgrade_migratefs_gui.py index 622c21cb4..dd3de5c39 100644 --- a/iw/upgrade_migratefs_gui.py +++ b/iw/upgrade_migratefs_gui.py @@ -60,8 +60,8 @@ class UpgradeMigrateFSWindow (InstallWindow): return None def getScreen (self, anaconda): - self.devicetree = anaconda.id.storage.devicetree - self.migent = anaconda.id.storage.migratableDevices + self.devicetree = anaconda.storage.devicetree + self.migent = anaconda.storage.migratableDevices box = gtk.VBox (False, 5) box.set_border_width (5) diff --git a/iw/upgrade_swap_gui.py b/iw/upgrade_swap_gui.py index 53a2357e1..0edba095e 100644 --- a/iw/upgrade_swap_gui.py +++ b/iw/upgrade_swap_gui.py @@ -78,7 +78,7 @@ class UpgradeSwapWindow (InstallWindow): def getScreen (self, anaconda): self.neededSwap = 0 - self.storage = anaconda.id.storage + self.storage = anaconda.storage self.intf = anaconda.intf self.dispatch = anaconda.dispatch -- cgit