[blivet:master 02/26] Comment mdraid.mdcreate() and update tests appropriately.
by Anne Mulhern
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
blivet/devicelibs/mdraid.py | 16 ++++++++++++++++
tests/devicelibs_test/mdraid_test.py | 5 +++--
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/blivet/devicelibs/mdraid.py b/blivet/devicelibs/mdraid.py
index d07f7bf..9e6cf15 100644
--- a/blivet/devicelibs/mdraid.py
+++ b/blivet/devicelibs/mdraid.py
@@ -114,6 +114,22 @@ def mdadm(args):
raise MDRaidError("running mdadm " + " ".join(args) + " failed")
def mdcreate(device, level, disks, spares=0, metadataVer=None, bitmap=False):
+ """ Create an mdarray from a list of devices.
+
+ :param str device: the path for the array
+ :param level: the level of the array
+ :type level: :class:`~.devicelibs.raid.RAIDLevel` or string
+ :param disks: the members of the array
+ :type disks: list of str
+ :param int spares: the number of spares in the array
+ :param str metadataVer: one of the mdadm metadata versions
+ :param bool bitmap: whether to create an internal bitmap on the device
+
+ Note that if the level is specified as a string, rather than by means
+ of a RAIDLevel object, it is not checked for validity. It is the
+ responsibility of the invoking method to verify that mdadm recognizes
+ the string.
+ """
argv = ["--create", device, "--run", "--level=%s" % level]
raid_devs = len(disks) - spares
argv.append("--raid-devices=%d" % raid_devs)
diff --git a/tests/devicelibs_test/mdraid_test.py b/tests/devicelibs_test/mdraid_test.py
index 8de5414..04af534 100755
--- a/tests/devicelibs_test/mdraid_test.py
+++ b/tests/devicelibs_test/mdraid_test.py
@@ -3,6 +3,7 @@ import os
import unittest
import time
+import blivet.devicelibs.raid as raid
import blivet.devicelibs.mdraid as mdraid
from blivet.errors import MDRaidError
from blivet.size import Size
@@ -75,12 +76,12 @@ class MDRaidAsRootTestCase(baseclass.DevicelibsTestCase):
## mdcreate
##
# pass
- self.assertEqual(mdraid.mdcreate(self._dev_name, 1, [_LOOP_DEV0, _LOOP_DEV1]), None)
+ self.assertEqual(mdraid.mdcreate(self._dev_name, raid.RAID1, [_LOOP_DEV0, _LOOP_DEV1]), None)
# wait for raid to settle
time.sleep(2)
# fail
- self.assertRaises(MDRaidError, mdraid.mdcreate, "/dev/md1", 1, ["/not/existing/dev0", "/not/existing/dev1"])
+ self.assertRaises(MDRaidError, mdraid.mdcreate, "/dev/md1", "raid1", ["/not/existing/dev0", "/not/existing/dev1"])
##
## mddeactivate
--
1.8.3.1
9 years, 11 months
[PATCH] Allow a couple more keyboard shortcuts on the custom part spoke.
by Chris Lumens
(1) '-' should do the same thing as delete.
(2) '+' should bring up the add dialog.
---
pyanaconda/ui/gui/spokes/custom.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 328cf61..d04eda9 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1422,17 +1422,20 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
###
def on_key_pressed(self, window, event, *args):
- # Handle any keyboard events. Right now this is just delete for
- # removing an existing mountpoint, but it could include more later.
if not event or event and event.type != Gdk.EventType.KEY_RELEASE:
return
- if event.keyval == Gdk.KEY_Delete:
+ if event.keyval in [Gdk.KEY_Delete, Gdk.KEY_minus]:
# But we only want delete to work if you have focused a MountpointSelector,
# and not just any random widget. For those, it's likely the user wants
# to delete a character.
if isinstance(window.get_focus(), MountpointSelector):
self._removeButton.emit("clicked")
+ elif event.keyval == Gdk.KEY_plus:
+ # And we only want '+' to work if you don't have a text entry focused, since
+ # the user might be entering some free-form text that can include a plus.
+ if not isinstance(window.get_focus(), Gtk.Entry):
+ self._addButton.emit("clicked")
def _do_check(self):
self.clear_errors()
--
1.9.0
9 years, 11 months
[blivet:master 04/26] Extract selection of members in complete() into a separate method.
by Anne Mulhern
Use it in complete().
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
blivet/devices.py | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/blivet/devices.py b/blivet/devices.py
index f13ba8a..3246565 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -3605,13 +3605,27 @@ class MDRaidArrayDevice(ContainerDevice):
return rc
@property
- def complete(self):
+ def members(self):
+ """ Returns this array's members.
+
+ If the array is a BIOS RAID array then its unique parent
+ is a container and its actual member devices are the
+ container's parents.
+
+ :rtype: list of :class:`StorageDevice`
+ """
if self.type == "mdbiosraidarray":
- members = len(self.parents[0].parents)
+ members = self.parents[0].parents
else:
- members = len(self.parents)
+ members = self.parents
+ return list(members)
- return (self.memberDevices <= members) or not self.exists
+ @property
+ def complete(self):
+ """ An MDRaidArrayDevice is complete if it has at least as many
+ component devices as its count of active devices.
+ """
+ return (self.memberDevices <= len(self.members)) or not self.exists
@property
def devices(self):
--
1.8.3.1
9 years, 11 months
[PATCH] Fix up quoting around passing args to anaconda in the gui test.
by Chris Lumens
We go through a lot of layers - command line to shell a couple different ways,
then through noseconfig-testconfig, and into a python template, and finally
written into a python file. Along the way, the string that actually runs
liveinst ended up looking like so:
"liveinst "--updates=http://wherever/updates.img""
Which clearly is never going to work. The changes in this patch make that one
continuous string, plus handle what happens if you want to pass multiple
arguments or no arguments.
---
tests/gui/outside/__init__.py | 2 +-
tests/gui/runtest.sh | 21 +++++++++++++--------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/tests/gui/outside/__init__.py b/tests/gui/outside/__init__.py
index f3d804f..823b84e 100644
--- a/tests/gui/outside/__init__.py
+++ b/tests/gui/outside/__init__.py
@@ -164,7 +164,7 @@ class Creator(object):
f.write(self.template % {"imports": "\n".join(imports),
"addtests": "\n".join(addtests),
- "anacondaArgs": config.get("anacondaArgs", "")})
+ "anacondaArgs": config.get("anacondaArgs", "").strip('"')})
finally:
# pylint: disable=undefined-variable
b.devicetree.teardownDiskImages()
diff --git a/tests/gui/runtest.sh b/tests/gui/runtest.sh
index 87f2ee7..86f8e52 100755
--- a/tests/gui/runtest.sh
+++ b/tests/gui/runtest.sh
@@ -19,12 +19,17 @@
# Red Hat Author(s): Chris Lumens <clumens(a)redhat.com>
function doit() {
- nosetests -s \
- -v \
- --nologcapture \
- --tc=resultsdir:$(mktemp -d --tmpdir=/var/tmp autogui-results-XXXXXX) \
- --tc=liveImage:"$1" $2 \
- outside
+ ARGS="-s \
+ -v \
+ --nologcapture \
+ --tc=resultsdir:$(mktemp -d --tmpdir=/var/tmp autogui-results-XXXXXX) \
+ --tc=liveImage:"$1""
+
+ if [ -z "$2" ]; then
+ nosetests ${ARGS} outside
+ else
+ nosetests ${ARGS} "${2}" outside
+ fi
}
# We require the test_config plugin for nose, which is not currently packaged
@@ -67,9 +72,9 @@ fi
# If we're being called from "make check", we will be outside the gui test directory.
# Unfortunately, everything is written assuming that's where we will be. So cd there.
if [ -d gui ]; then
- ( cd gui && doit "${LIVECD}" ${EXTRA} )
+ ( cd gui && doit "${LIVECD}" "${EXTRA}" )
elif [ -d outside ]; then
- doit "${LIVECD}" ${EXTRA}
+ doit "${LIVECD}" "${EXTRA}"
else
echo "Could not find test contents"
exit 3
--
1.9.0
9 years, 11 months
[PATCH] Display the sentence about being able to reuse partitions even without roots.
by Chris Lumens
Right now we're only putting the sentence about being able to reuse partitions
into the new page of the accordion if there are recognized roots. However, it's
possible to have fully reusable partitions outside of a root. This patch points
out that possibility.
---
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 d04eda9..18241b8 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -459,7 +459,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
page = CreateNewPage(translated_new_install_name(),
self.on_create_clicked,
self._change_autopart_type,
- partitionsToReuse=bool(ui_roots))
+ partitionsToReuse=bool(ui_roots) or bool(self.unusedDevices))
self._accordion.addPage(page, cb=self.on_page_clicked)
self._partitionsNotebook.set_current_page(NOTEBOOK_LABEL_PAGE)
--
1.9.0
9 years, 11 months
[PATCH 0/4] v2: bootloader updates for rawhide/F21
by Gene Czarcinski
The anaconda updates are all related to the bootloader configuration.
1. The updated grub2-2.02 now supports /boot on a LVMlv or a directory on /.
2. With grub2.02 and os-prober both fixed to handle /boot on btrfs, only
grubby remains a blocker. BZ 1094489 has an attached patch which updates
grubby.c to handle btrfs. This is a "chicken and an egg" problem since
it needs to be enabled to test grubby.
3. Bugfix patch so that liveinst works and produces a good grub.cfg and
a good extlinux.conf. This address BZ 1099627 and BZ 1100504.
4. Bugfix patch so the extlinux.conf will include an entry for the rescue
kernel. This addresses rhbz1036349 and rhbz1100504.
Gene Czarcinski (4):
Allow /boot on LVMlv
allow /boot on btrfs subvol or filesystem
move new-kernel-pkg rpmposttrans to end of install
always rescan for vmlinuz if rescueKernelList
pyanaconda/bootloader.py | 3 ++-
pyanaconda/packaging/__init__.py | 5 ++---
pyanaconda/packaging/livepayload.py | 12 ++++++------
3 files changed, 10 insertions(+), 10 deletions(-)
--
1.9.3
9 years, 11 months
[master] Four small fixes for the TUI storage spokes
by Vratislav Podzimek
These four patches fix some hidden and unrevealed issues in the storage spokes.
Vratislav Podzimek (4):
Use enumerate() instead of getting indices of iterated items
Define default autopart type as a constant
Order the autopart types in the same way in GUI and TUI
Translate autopart type descriptions in the TUI
pyanaconda/constants.py | 2 ++
pyanaconda/ui/gui/spokes/lib/accordion.py | 12 ++++++++----
pyanaconda/ui/tui/spokes/storage.py | 29 ++++++++++++++---------------
3 files changed, 24 insertions(+), 19 deletions(-)
--
1.9.3
9 years, 11 months
[PATCH] Preserve net.ifnames cmdline arg (#1102401)
by Brian C. Lane
---
pyanaconda/bootloader.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index a67d79c..4cf0f4a 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -255,7 +255,8 @@ class BootLoader(object):
global_preserve_args = ["speakup_synth", "apic", "noapic", "apm", "ide",
"noht", "acpi", "video", "pci", "nodmraid",
"nompath", "nomodeset", "noiswmd", "fips",
- "selinux", "biosdevname", "ipv6.disable"]
+ "selinux", "biosdevname", "ipv6.disable",
+ "net.ifnames"]
preserve_args = []
_trusted_boot = False
--
1.9.3
9 years, 11 months
[PATCH 1/3] Add a -c argument to the ksflatten invocation.
by Chris Lumens
---
tests/gui/make_livecd.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/gui/make_livecd.sh b/tests/gui/make_livecd.sh
index f242a1c..0709a11 100755
--- a/tests/gui/make_livecd.sh
+++ b/tests/gui/make_livecd.sh
@@ -54,9 +54,9 @@ REPO="$3"
# (1) Remove the first two / partitions we inherit.
# (2) Remove rawhide as a repo because it's already the installation source.
# (3) Don't remove /boot/initramfs*. Do what now?
-ksflatten anaconda-autogui-testing.ks | sed -e '\|part /.*--size=3.*|,+1 d' \
- -e '/repo --name="rawhide"/ d' \
- -e '/^# save a little/,+1 d' > livecd.ks
+ksflatten -c anaconda-autogui-testing.ks | sed -e '\|part /.*--size=3.*|,+1 d' \
+ -e '/repo --name="rawhide"/ d' \
+ -e '/^# save a little/,+1 d' > livecd.ks
# Add a repo location for the updated anaconda RPMs.
echo -e "\nrepo --name=updated-anaconda --baseurl=${REPO}\n" >> livecd.ks
--
1.9.0
9 years, 11 months
[anaconda][master][PATCH] Cleanup Anaconda output when printing version
by Martin Kolman
Previously "python anaconda --version" returned:
No handlers could be found for logger "anaconda"
anaconda 21.37-1
With this patch, it is just:
anaconda 21.37-1
Martin Kolman (1):
Do basic logging setup when short circuiting the normal Anaconda init
anaconda | 6 ++++++
1 file changed, 6 insertions(+)
--
1.9.3
9 years, 11 months