[blivet:master 00/26] RAID patches
by Anne Mulhern
These patches will be vaguely remniscent of the last set of RAID related
patches I sent out, but not all that close.
The changes require an anaconda patch.
The first four are nice and simple.
The very last is only related to RAID because I felt
I had to understand the method in order to understand device populateKSData()
methods, and to understand it I had to think about, so I ended up rewriting it.
mulhern (26):
Import name 'lvm' instead of names from lvm package.
Comment mdraid.mdcreate() and update tests appropriately.
Remove DMRaidArrayDevice.members property.
Extract selection of members in completed() into a separate method.
No longer use _standard_levels as the default set of RAID levels.
Adjust RaidLevel hierarchy so that all raid level objects extend
RAIDLevel
Allow the RAID object itself to be a valid RAID descriptor for lookup.
Move Container class to raid package and tidy it up
Add Linear and Single to the RAID classes.
Add a has_redundancy method that returns True if there is actual
redundancy
Add an is_uniform property to the RAID levels.
Add a Dup class to the various descendants of RAIDLevel.
Make createBitmap() a property and update tests appropriately.
Use has_redundancy raid property when checking whether a device is
removable
Update the mdraid.mdadd comments
Use has_redundancy property to decide how to add a member to an array.
Check for required methods in MDRaidLevels.isRaidLevel.
Remove getRaidLevel() from mdraid file and make RAID_levels public
Add "linear" to mdraid's list of supported raid levels.
Add lists of supported RAID levels for btrfs and lvm
Make BTRFS devices use RAID objects instead of strings for levels
Put get_supported_raid_levels in devicefactory.py
Distribute devicefactory.get_raid_level within devices classes.
Make all devicefactory classes uses RAID objects instead of strings.
Move the code for getting a space requirement from devicefactory to
raid.
Simplify a small chunk of Blivet.updateKSData()
blivet/__init__.py | 12 +-
blivet/devicefactory.py | 137 ++++++++++------
blivet/devicelibs/btrfs.py | 10 +-
blivet/devicelibs/lvm.py | 3 +
blivet/devicelibs/mdraid.py | 64 +++-----
blivet/devicelibs/raid.py | 297 +++++++++++++++++++++++++----------
blivet/devices.py | 186 +++++++++++++++++-----
tests/devicefactory_test.py | 26 +--
tests/devicelibs_test/mdraid_test.py | 21 +--
tests/devicelibs_test/raid_test.py | 73 ++++-----
tests/devices_test.py | 58 +++++--
tests/devicetree_test.py | 2 +-
12 files changed, 590 insertions(+), 299 deletions(-)
--
1.8.3.1
9 years, 11 months
[blivet:master] RAID patches addendum 1
by Anne Mulhern
Getting the unencrypted backing device
is an action that happens over and over in blivet
DeviceFactory and in anaconda custom spoke as well. I'ld like to make this
a Device property and be consistant in always checking isinstance instead
of some times checking the type string. Right now, checking either amounts
to the same, because nothing extends LUKSDevice, but that could change.
mulhern (1):
Make a StorageDevice.raw_device property and use it where appropriate
blivet/devicefactory.py | 16 +++-------------
blivet/devices.py | 9 +++++++++
tests/devices_test.py | 1 +
3 files changed, 13 insertions(+), 13 deletions(-)
--
1.8.3.1
9 years, 11 months
[PATCH] change default for grub2 save_entry to 0
by Gene Czarcinski
The value that anaconda sets save_entry in /boot/grub2/grubenv is
not valid as there is no corresponding menuentry with that title. The
only reason things work now is that if grub2 finds no match, it boots
the kernel specified in the first (top) menuentry.
grub2-set-default --help results in:
MENU_ENTRY is a number, a menu item title or a menu item identifier
This patch changes the default to be "0".
This results in the value now being correct, produces an expected
result (booting the first kernel), and not requiring any changes
to grubby.
The user will still be able to use grub2-set-default to change the
default value to other settings.
---
pyanaconda/bootloader.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 96c98b4..116c2b9 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1561,8 +1561,7 @@ class GRUB2(GRUB):
log.error("bootloader password setup failed: %s", e)
# make sure the default entry is the OS we are installing
- entry_title = "%s Linux, with Linux %s" % (productName,
- self.default.version)
+ entry_title = "0"
rc = iutil.execInSysroot("grub2-set-default", [entry_title])
if rc:
log.error("failed to set default menu entry to %s", productName)
--
1.9.3
9 years, 11 months
[blivet:master] IPSeriesPPC now supports GPT in Open Firmware
by Mark Hamzy
IBM PowerPC's Open Firmware now supports GPT partitioning.
---
blivet/platform.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/blivet/platform.py b/blivet/platform.py
index 600d66b..498d08c 100644
--- a/blivet/platform.py
+++ b/blivet/platform.py
@@ -246,10 +246,10 @@ class IPSeriesPPC(PPC):
_boot_stage1_max_end = Size("4 GiB")
_boot_prep_description = N_("PReP Boot Partition")
_boot_descriptions = {"partition": _boot_prep_description}
- _disklabel_types = ["msdos"]
+ _disklabel_types = ["msdos", "gpt"]
_boot_stage1_missing_error = N_("You must include a PReP Boot Partition "
- "within the first 4GiB of an MBR-formatted "
- "disk.")
+ "within the first 4GiB of an MBR- "
+ "or GPT-formatted disk.")
def setDefaultPartitioning(self):
ret = PPC.setDefaultPartitioning(self)
--
1.9.0
9 years, 11 months
[PATCH] Work around a parsing bug in GtkBuilder
by David Shea
Add a check for a condition that was broken by gtk+ commit
49fa04212b644f19ce576a8011e3f4fcda6a0806 and garbage up the glade files
to work around it.
---
pyanaconda/ui/gui/spokes/advstorage/iscsi.glade | 1 +
pyanaconda/ui/gui/spokes/datetime_spoke.glade | 1 +
pyanaconda/ui/gui/spokes/filter.glade | 4 ++
pyanaconda/ui/gui/spokes/keyboard.glade | 2 +
pyanaconda/ui/gui/spokes/langsupport.glade | 2 +
pyanaconda/ui/gui/spokes/lib/cart.glade | 1 +
pyanaconda/ui/gui/spokes/lib/resize.glade | 1 +
pyanaconda/ui/gui/spokes/source.glade | 2 +
pyanaconda/ui/gui/spokes/welcome.glade | 2 +
tests/glade/bz1102793/check_bz1102793.py | 64 +++++++++++++++++++++++++
10 files changed, 80 insertions(+)
create mode 100755 tests/glade/bz1102793/check_bz1102793.py
diff --git a/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade b/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
index 1c9b9ea..9b5c6f0 100644
--- a/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
+++ b/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
@@ -728,6 +728,7 @@
<object class="GtkTreeViewColumn" id="nodeSelectedColumn">
<child>
<object class="GtkCellRendererToggle" id="nodeSelectedRenderer">
+ <property name="activatable">True</property>
<signal name="toggled" handler="on_row_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.glade b/pyanaconda/ui/gui/spokes/datetime_spoke.glade
index d58e2e7..c9bc520 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.glade
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.glade
@@ -204,6 +204,7 @@
<property name="title" translatable="yes">Use</property>
<child>
<object class="GtkCellRendererToggle" id="removeRenderer">
+ <property name="activatable">True</property>
<signal name="toggled" handler="on_use_server_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/filter.glade b/pyanaconda/ui/gui/spokes/filter.glade
index 36bc432..f8163c0 100644
--- a/pyanaconda/ui/gui/spokes/filter.glade
+++ b/pyanaconda/ui/gui/spokes/filter.glade
@@ -345,6 +345,7 @@
<object class="GtkTreeViewColumn" id="searchSelectedCol">
<child>
<object class="GtkCellRendererToggle" id="searchSelectedRenderer">
+ <property name="activatable">True</property>
<signal name="toggled" handler="on_row_toggled" swapped="no"/>
</object>
<attributes>
@@ -726,6 +727,7 @@
<object class="GtkTreeViewColumn" id="multipathSelectedCol">
<child>
<object class="GtkCellRendererToggle" id="multipathSelectedRenderer">
+ <property name="activatable">True</property>
<signal name="toggled" handler="on_row_toggled" swapped="no"/>
</object>
<attributes>
@@ -1072,6 +1074,7 @@
<object class="GtkTreeViewColumn" id="otherSelectedCol">
<child>
<object class="GtkCellRendererToggle" id="otherSelectedRenderer">
+ <property name="activatable">True</property>
<signal name="toggled" handler="on_row_toggled" swapped="no"/>
</object>
<attributes>
@@ -1308,6 +1311,7 @@
<object class="GtkTreeViewColumn" id="zSelectedCol">
<child>
<object class="GtkCellRendererToggle" id="zSelectedRenderer">
+ <property name="activatable">True</property>
<signal name="toggled" handler="on_row_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/keyboard.glade b/pyanaconda/ui/gui/spokes/keyboard.glade
index 69c8bfc..edaa247 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.glade
+++ b/pyanaconda/ui/gui/spokes/keyboard.glade
@@ -145,6 +145,7 @@
<property name="search_column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="layoutSelection">
+ <property name="mode">single</property>
<signal name="changed" handler="on_selection_changed" swapped="no"/>
</object>
</child>
@@ -707,6 +708,7 @@
<property name="title" translatable="yes">use</property>
<child>
<object class="GtkCellRendererToggle" id="useRenderer">
+ <property name="activatable">True</property>
<signal name="toggled" handler="on_use_option_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/langsupport.glade b/pyanaconda/ui/gui/spokes/langsupport.glade
index 5cf9cad..b595e44 100644
--- a/pyanaconda/ui/gui/spokes/langsupport.glade
+++ b/pyanaconda/ui/gui/spokes/langsupport.glade
@@ -117,6 +117,7 @@
<property name="search_column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="languageViewSelection">
+ <property name="mode">single</property>
<signal name="changed" handler="on_lang_selection_changed" swapped="no"/>
</object>
</child>
@@ -215,6 +216,7 @@
<property name="title" translatable="yes">checked</property>
<child>
<object class="GtkCellRendererToggle" id="checkedRenderer">
+ <property name="activatable">True</property>
<signal name="toggled" handler="on_locale_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/lib/cart.glade b/pyanaconda/ui/gui/spokes/lib/cart.glade
index 9e9af05..cd3ff24 100644
--- a/pyanaconda/ui/gui/spokes/lib/cart.glade
+++ b/pyanaconda/ui/gui/spokes/lib/cart.glade
@@ -98,6 +98,7 @@
<property name="model">disk_store</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="disk_selection">
+ <property name="mode">single</property>
<signal name="changed" handler="on_selection_changed" swapped="no"/>
</object>
</child>
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.glade b/pyanaconda/ui/gui/spokes/lib/resize.glade
index 147f22e..3413f5e 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.glade
+++ b/pyanaconda/ui/gui/spokes/lib/resize.glade
@@ -144,6 +144,7 @@
<signal name="row-activated" handler="on_row_clicked" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection" id="diskView-selection">
+ <property name="mode">single</property>
<signal name="changed" handler="on_selection_changed" swapped="no"/>
</object>
</child>
diff --git a/pyanaconda/ui/gui/spokes/source.glade b/pyanaconda/ui/gui/spokes/source.glade
index 38e4d16..2f672b2 100644
--- a/pyanaconda/ui/gui/spokes/source.glade
+++ b/pyanaconda/ui/gui/spokes/source.glade
@@ -960,6 +960,7 @@
<property name="enable_search">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="repoSelection">
+ <property name="mode">single</property>
<signal name="changed" handler="on_repoSelection_changed" swapped="no"/>
</object>
</child>
@@ -968,6 +969,7 @@
<property name="title" translatable="yes">Enabled</property>
<child>
<object class="GtkCellRendererToggle" id="repoEnableRenderer">
+ <property name="activatable">True</property>
<signal name="toggled" handler="on_repoEnable_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/welcome.glade b/pyanaconda/ui/gui/spokes/welcome.glade
index ac73bb8..63b59a5 100644
--- a/pyanaconda/ui/gui/spokes/welcome.glade
+++ b/pyanaconda/ui/gui/spokes/welcome.glade
@@ -256,6 +256,7 @@
<property name="search_column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="languageViewSelection">
+ <property name="mode">single</property>
<signal name="changed" handler="on_lang_selection_changed" swapped="no"/>
</object>
</child>
@@ -354,6 +355,7 @@
<property name="search_column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="localeViewSelection">
+ <property name="mode">single</property>
<signal name="changed" handler="on_locale_selection_changed" swapped="no"/>
</object>
</child>
diff --git a/tests/glade/bz1102793/check_bz1102793.py b/tests/glade/bz1102793/check_bz1102793.py
new file mode 100755
index 0000000..54526c6
--- /dev/null
+++ b/tests/glade/bz1102793/check_bz1102793.py
@@ -0,0 +1,64 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2014 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published
+# by the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: David Shea <dshea(a)redhat.com>
+
+# Check for objects that contain only a signal element, because GtkBuilder
+# screws these up. This check and its associated changes can be reverted as
+# soon as gtk gets its shit together.
+
+import sys
+import argparse
+
+try:
+ from lxml import etree
+except ImportError:
+ print("You need to install the python-lxml package to run the glade checks")
+ sys.exit(99)
+
+success = True
+
+def main(argv):
+ global success
+
+ for glade_file in argv:
+ # Look for object elements that contain a single signal child and no other children
+ glade_tree = etree.parse(glade_file)
+
+ for problem in glade_tree.xpath("//object[count(child::*) = 1 and local-name(./*) = 'signal']"):
+ print("Problematic signal found at %s:%d" % (glade_file, problem.sourceline))
+ success = False
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser("Check for glade files affected by bug 1102793")
+
+ # Ignore translation arguments
+ parser.add_argument("-t", "--translate", action='store_true',
+ help=argparse.SUPPRESS)
+ parser.add_argument("-p", "--podir", action='store', type=str,
+ metavar='PODIR', help=argparse.SUPPRESS, default='./po')
+
+ parser.add_argument("glade_files", nargs="+", metavar="GLADE-FILE",
+ help='The glade file to check')
+ args = parser.parse_args(args=sys.argv[1:])
+
+ main(args.glade_files)
+
+ if success:
+ sys.exit(0)
+ else:
+ sys.exit(1)
--
1.9.0
9 years, 11 months
[anaconda:master] Change 'elif encrypted' statement to 'else' statement.
by Anne Mulhern
The enclosing if statement is 'if not encrypted' so 'else' and
'elif encrypted' are eqivalent.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
pyanaconda/ui/gui/spokes/custom.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 18241b8..e98c0e8 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -754,7 +754,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
device = device.slave
selector.device = device
self._update_device_in_selectors(old_device, device)
- elif encrypted:
+ else:
log.info("applying encryption to %s", device.name)
old_device = device
new_fmt = getFormat("luks", device=device.path)
--
1.8.3.1
9 years, 11 months
[PATCH] Reword the close button on the software spoke's error dialog.
by Chris Lumens
If you hit a problem with your software selections (like file conflicts or
other packaging problems), you don't really want to cancel. What does that
even mean in this context? Likely, you want to close the dialog so you can
change software selections. For instance, you might change from a desktop
to a minimal install so you at least have something installed.
Thus, change the wording on the button. What the button actually does has
not changed. While I was at it I moved the button to the right side (default
action goes on the right) and reworded the label to reflect all the buttons.
---
pyanaconda/ui/gui/spokes/software.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index f1f0bdf..8325a57 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -464,13 +464,14 @@ class SoftwareSelectionSpoke(NormalSpoke):
if not self._errorMsgs:
return
- label = _("The following software marked for installation has errors. "
- "This is likely caused by an error with\nyour installation source. "
- "You can change your installation source or quit the installer.")
+ label = _("The software marked for installation has the following errors. "
+ "This is likely caused by an error with your installation source. "
+ "You can quit the installer, change your software source, or change "
+ "your software selections.")
dialog = DetailedErrorDialog(self.data,
buttons=[C_("GUI|Software Selection|Error Dialog", "_Quit"),
- C_("GUI|Software Selection|Error Dialog", "_Cancel"),
- C_("GUI|Software Selection|Error Dialog", "_Modify Software Source")],
+ C_("GUI|Software Selection|Error Dialog", "_Modify Software Source"),
+ C_("GUI|Software Selection|Error Dialog", "Modify _Selections")],
label=label)
with enlightbox(self.window, dialog.window):
dialog.refresh(self._errorMsgs)
@@ -482,11 +483,11 @@ class SoftwareSelectionSpoke(NormalSpoke):
# Quit.
sys.exit(0)
elif rc == 1:
- # Close the dialog so the user can change selections.
- pass
- elif rc == 2:
# Send the user to the installation source spoke.
self.skipTo = "SourceSpoke"
self.window.emit("button-clicked")
+ elif rc == 2:
+ # Close the dialog so the user can change selections.
+ pass
else:
pass
--
1.9.0
9 years, 11 months
[PATCH] Don't uppercase the size values in the disk shopping cart.
by Chris Lumens
"16 GIB" looks weird. Also get rid of all the unnecessary conversion between
Size and long and Size again.
---
pyanaconda/ui/gui/spokes/lib/cart.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/lib/cart.py b/pyanaconda/ui/gui/spokes/lib/cart.py
index 90b9818..5252025 100644
--- a/pyanaconda/ui/gui/spokes/lib/cart.py
+++ b/pyanaconda/ui/gui/spokes/lib/cart.py
@@ -120,15 +120,15 @@ class SelectedDisksDialog(GUIObject):
def _update_summary(self):
count = 0
- size = 0
- free = 0
+ size = Size(0)
+ free = Size(0)
for row in self._store:
count += 1
size += Size(row[SIZE_COL])
free += Size(row[FREE_SPACE_COL])
- size = str(Size(long(size))).upper()
- free = str(Size(long(free))).upper()
+ size = str(size)
+ free = str(free)
# pylint: disable=unescaped-markup
text = P_("<b>%(count)d disk; %(size)s capacity; %(free)s free space</b> "
--
1.9.0
9 years, 11 months
[anaconda:master] RAID patch
by Anne Mulhern
The main purpose of this patch is to accomodate changes in blivet and to
ensure that RAIDLevel objects, rather than strings are used throughout.
The main problem was disentangling blivets notion of supported RAID levels for
various device types, from anaconda's notion of what it would like to allow
the user, especially since the whole idea is really a devicefactory one.
I will updated required version of blivet as appropriate.
mulhern (1):
RAID related changes for custom spoke.
pyanaconda/storage_utils.py | 17 ---
pyanaconda/ui/gui/spokes/custom.glade | 4 -
pyanaconda/ui/gui/spokes/custom.py | 88 ++++++------
.../ui/gui/spokes/lib/custom_storage_helpers.glade | 8 +-
.../ui/gui/spokes/lib/custom_storage_helpers.py | 151 +++++++++++++++++----
5 files changed, 179 insertions(+), 89 deletions(-)
--
1.8.3.1
9 years, 11 months
[blivet:master 23/26] Remove devicefactory.get_raid_level from blivet
by Anne Mulhern
It's really about the anaconda GUI, so that's where it should go.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
blivet/devicefactory.py | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py
index 8dd41c8..01c75a2 100644
--- a/blivet/devicefactory.py
+++ b/blivet/devicefactory.py
@@ -89,24 +89,7 @@ def get_device_type(device):
return device_type
-def get_raid_level(device):
- # TODO: move this into StorageDevice
- use_dev = device
- if isinstance(device, LUKSDevice):
- use_dev = device.slave
- # TODO: lvm and perhaps pulling raid level from md pvs
- raid_level = None
- if hasattr(use_dev, "level"):
- raid_level = use_dev.level.name
- elif hasattr(use_dev, "dataLevel"):
- raid_level = use_dev.dataLevel or "single"
- elif hasattr(use_dev, "volume"):
- raid_level = use_dev.volume.dataLevel or "single"
- elif hasattr(use_dev, "lvs") and len(use_dev.parents) == 1:
- raid_level = get_raid_level(use_dev.parents[0])
-
- return raid_level
def get_device_factory(blivet, device_type, size, **kwargs):
""" Return a suitable DeviceFactory instance for device_type. """
--
1.8.3.1
9 years, 11 months