[master/rhel7-branch] Re-apply disk selection on error in TUi storage. (#1056316)
by Samantha N. Bueno
This copies over some more logic from the GUI storage spoke that should
make error handling a bit more sane.
Resolves: rhbz#1056316
---
pyanaconda/ui/tui/spokes/storage.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
index b4d40f1..c9a356a 100644
--- a/pyanaconda/ui/tui/spokes/storage.py
+++ b/pyanaconda/ui/tui/spokes/storage.py
@@ -283,6 +283,15 @@ class StorageSpoke(NormalTUISpoke):
# user may have set up before now.
self.storage.config.clearNonExistent = self.data.autopart.autopart
+ def _applyDiskSelection(self, use_names):
+ onlyuse = use_names[:]
+ for disk in (d for d in self.storage.disks if d.name in onlyuse):
+ onlyuse.extend(d.name for d in disk.ancestors
+ if d.name not in onlyuse)
+
+ self.data.ignoredisk.onlyuse = onlyuse
+ self.data.clearpart.drives = use_names[:]
+
def execute(self):
print(_("Generating updated storage configuration"))
try:
@@ -297,6 +306,8 @@ class StorageSpoke(NormalTUISpoke):
self.storage.config.update(self.data)
self.storage.autoPartType = self.data.clearpart.type
self.storage.reset()
+ # now set ksdata back to the user's specified config
+ self._applyDiskSelection(self.selected_disks)
self._ready = True
except BootLoaderError as e:
log.error("BootLoader setup failed: %s", e)
--
1.8.3.1
10 years, 3 months
[PATCH anaconda:rhel7/master v2] Seed the default devicetree value for ARMv8
by d.marlin
In order to add a devicetree entry in the grub.cfg file, a valid
default value is needed. This can be provided in the grub default
file (GRUB_DEFAULT_DTB in /etc/default/grub).
Set the default value to apm-mustang.dtb, since that is the only
hardware we currently have. This value can be changed later
(post install), but some valid value must be set in order to seed
the variable.
Signed-off-by: David A. Marlin <dmarlin(a)redhat.com>
---
pyanaconda/bootloader.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index bc0ce8f..fb38ab9 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1740,6 +1740,16 @@ class Aarch64EFIGRUB(EFIGRUB):
_serial_consoles = ["ttyAMA", "ttyS"]
+ #
+ # In addition to the normal grub configuration variables,
+ # add one more to set the default device-tree filename
+ #
+ def write_defaults(self):
+ super(EFIGRUB, self).write_defaults()
+
+ defaults_file = os.path.normpath(ROOT_PATH + "/" + self.defaults_file)
+ with open(defaults_file, "a+") as defaults
+ defaults.write("GRUB_DEFAULT_DTB=\"apm-mustang.dtb\"\n")
class MacEFIGRUB(EFIGRUB):
def mactel_config(self):
--
1.7.1
10 years, 3 months
[rhel7-branch] fix heredoc usage
by David Cantrell
I'm not even sure my patch sending script works anymore, but here it goes. I
suppose this is appropriate for master as well.
--
David Cantrell <dcantrell(a)redhat.com>
Manager, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT
10 years, 3 months
[blivet:rhel7/master] Add a coverage test target (#1064895)
by Anne Mulhern
Resolves: rhbz#1064895
Submitted by: Alexander Todorov <atodorov(a)redhat.com>
Revised by: mulhern <amulhern(a)redhat.com>
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
Makefile | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Makefile b/Makefile
index 872d0c1..1079faa 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,12 @@ test:
@echo "*** Running unittests ***"
PYTHONPATH=.:tests/ python -m unittest discover -v -s tests/ -p '*_test.py'
+coverage:
+ @which coverage || (echo "*** Please install python-coverage ***"; exit 2)
+ @echo "*** Running unittests with coverage ***"
+ PYTHONPATH=.:tests/ coverage run --branch -m unittest discover -v -s tests/ -p '*_test.py'
+ coverage report --include="blivet/*"
+
clean:
-rm *.tar.gz blivet/*.pyc blivet/*/*.pyc ChangeLog
$(MAKE) -C po clean
--
1.8.3.1
10 years, 3 months
[PATCH] Preserve ipv6.disable=1 on target system (#1040751)
by Will Woods
In Olden Times anaconda had the "noipv6" boot argument, which disabled
ipv6 in the installer and on the target system. It did this by adding
"options ipv6 disable=1" to /etc/modprobe.d/ipv6.conf, so ipv6 would be
disabled before the network came up.
Now that ipv6 isn't modular, we can't do that. In an attempt to retain
backward-compatibility, "noipv6" now causes anaconda to disable ipv6 via
sysctl (i.e. in /etc/sysctl.d/anaconda.conf) - *iff* all network devices
have ipv6 disabled (by 'network --noipv6' kickstart commands or the
'ipv6.disable=1' boot argument).
This can be a bit confusing:
* If you netboot with 'noipv6' but no kickstart, the system gets ipv6.
* If you netboot with 'noipv6 ipv6.disable=1', the system does ipv6 for
a moment, then disables it via sysctl.
* Neither boot argument is preserved, so it's unclear to users
how/whether the system has ipv6 disabled.
This patch adds 'ipv6.disable' to global_preserve_args. This way,
booting with "ipv6.disable=1" will:
a) disable ipv6 in the installer, and
b) disable ipv6 on the target system before the network comes up.
This is a lot closer to the original behavior, and a lot simpler for us
as well.
---
docs/boot-options.txt | 6 ++++--
pyanaconda/bootloader.py | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/docs/boot-options.txt b/docs/boot-options.txt
index 10c85d4..c98c93c 100644
--- a/docs/boot-options.txt
+++ b/docs/boot-options.txt
@@ -400,8 +400,10 @@ All this option actually did was set `TERM=vt100`. The default `TERM` setting
works fine these days, so this was no longer necessary.
=== noipv6 ===
-ipv6 is built into the kernel and can't be removed. You should be able to
-disable it with `ipv6.disable`, though.
+ipv6 is built into the kernel and can't be removed by anaconda.
+
+You can disable ipv6 with `ipv6.disable=1`. This setting will be carried onto
+the installed system.
=== upgradeany ===
Anaconda doesn't handle upgrades anymore.
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index fb593c3..e2748e6 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -254,7 +254,7 @@ class BootLoader(object):
global_preserve_args = ["speakup_synth", "apic", "noapic", "apm", "ide",
"noht", "acpi", "video", "pci", "nodmraid",
"nompath", "nomodeset", "noiswmd", "fips",
- "selinux", "biosdevname"]
+ "selinux", "biosdevname", "ipv6.disable"]
preserve_args = []
_trusted_boot = False
--
1.8.5.3
10 years, 3 months
[blivet:rhel7/master 0/4] Make filesystem labeling tests not run when necessary utilities are missing from the environment (v2)
by Anne Mulhern
The two changes from previous version are:
* Patches that changed some methods to class methods using @classmethod and
changed invocations to match are left out.
* The filesystem labeling tests are omitted on a per method basis by a check in
LabelingAsRoot.setUp() as opposed to by annotations on classes.
First three patches in this set haven't changed at all from their previous
versions.
mulhern (4):
Move SwapSpace tests into a separate class (#1065422)
Refactor labeling tests (#1065422)
Rename misc_test.py to something more descriptive (#1065422)
Filesystem labeling tests will not run without utilities (#1065422)
tests/formats_test/fslabeling.py | 175 +++++++++++++++++
tests/formats_test/labeling_test.py | 147 +++++++++++++++
tests/formats_test/misc_test.py | 364 ------------------------------------
3 files changed, 322 insertions(+), 364 deletions(-)
create mode 100644 tests/formats_test/fslabeling.py
create mode 100755 tests/formats_test/labeling_test.py
delete mode 100755 tests/formats_test/misc_test.py
--
1.8.3.1
10 years, 3 months
[PATCH] Remove a stray break statement
by David Shea
---
pyanaconda/kickstart.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index e5f4171..1c5a64a 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -1083,7 +1083,6 @@ class PartitionData(commands.partition.F18_PartData):
should_clear = storage.shouldClear(disk)
if disk and (disk.partitioned or should_clear):
kwargs["parents"] = [disk]
- break
elif disk:
raise KickstartValueError(formatErrorMsg(self.lineno, msg="Specified unpartitioned disk %s in partition command" % self.disk))
--
1.8.5.3
10 years, 3 months
[PATCH] Don't use positional arguments to initialize Gtk objects
by David Shea
"PyGTKDeprecationWarning: Using positional arguments with the GObject
constructor has been deprecated."
Ok. Use keyword arguments everywhere we were using positional arguments
(mostly labels), except for a couple of instances of GtkTreeViewColumn
in network.py because they kinda half-assed the interface for that one
and pygobject doesn't complain about those anyway. Also rolled up some
lists of .set_<property> calls into constructor arguments.
---
pyanaconda/ui/gui/hubs/__init__.py | 14 +++------
pyanaconda/ui/gui/spokes/lib/accordion.py | 47 +++++++++++--------------------
pyanaconda/ui/gui/spokes/network.py | 7 ++---
pyanaconda/ui/gui/spokes/software.py | 12 +++-----
4 files changed, 26 insertions(+), 54 deletions(-)
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index e0f4d13..9afbd14 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -155,11 +155,8 @@ class Hub(GUIObject, common.Hub):
cats_and_spokes = self._collectCategoriesAndSpokes()
categories = cats_and_spokes.keys()
- grid = Gtk.Grid()
- grid.set_row_spacing(6)
- grid.set_column_spacing(6)
- grid.set_column_homogeneous(True)
- grid.set_margin_bottom(12)
+ grid = Gtk.Grid(row_spacing=6, column_spacing=6, column_homogeneous=True,
+ margin_bottom=12)
row = 0
@@ -229,11 +226,8 @@ class Hub(GUIObject, common.Hub):
if not selectors:
continue
- label = Gtk.Label("<span font-desc=\"Sans 14\">%s</span>" % escape_markup(_(obj.title)))
- label.set_use_markup(True)
- label.set_halign(Gtk.Align.START)
- label.set_margin_top(12)
- label.set_margin_bottom(12)
+ label = Gtk.Label(label="<span font-desc=\"Sans 14\">%s</span>" % escape_markup(_(obj.title)),
+ use_markup=True, halign=Gtk.Align.START, margin_top=12, margin_bottom=12)
grid.attach(label, 0, row, 2, 1)
row += 1
diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py
index f62f2fe..6528477 100644
--- a/pyanaconda/ui/gui/spokes/lib/accordion.py
+++ b/pyanaconda/ui/gui/spokes/lib/accordion.py
@@ -79,11 +79,9 @@ class Accordion(Gtk.Box):
self._expanders = []
def addPage(self, contents, cb=None):
- label = Gtk.Label()
- label.set_markup("""<span size='large' weight='bold' fgcolor='black'>%s</span>""" %
- escape_markup(contents.pageTitle))
- label.set_alignment(0, 0.5)
- label.set_line_wrap(True)
+ label = Gtk.Label(label="""<span size='large' weight='bold' fgcolor='black'>%s</span>""" %
+ escape_markup(contents.pageTitle), use_markup=True,
+ xalign=0, yalign=0.5, wrap=True)
expander = Gtk.Expander()
expander.set_label_widget(label)
@@ -273,19 +271,16 @@ class CreateNewPage(Page):
self._createBox.set_column_spacing(6)
self._createBox.set_margin_left(16)
- label = Gtk.Label(_("You haven't created any mount points for your "
+ label = Gtk.Label(label=_("You haven't created any mount points for your "
"%(product)s %(version)s installation yet. "
- "You can:") % {"product" : productName, "version" : productVersion})
- label.set_line_wrap(True)
- label.set_alignment(0, 0.5)
+ "You can:") % {"product" : productName, "version" : productVersion},
+ wrap=True, xalign=0, yalign=0.5)
self._createBox.attach(label, 0, 0, 2, 1)
- dot = Gtk.Label("•")
- dot.set_alignment(0.5, 0.4)
- dot.set_hexpand(False)
+ dot = Gtk.Label(label="•", xalign=0.5, yalign=0.4, hexpand=False)
self._createBox.attach(dot, 0, 1, 1, 1)
- self._createNewButton = Gtk.LinkButton("", label=_("_Click here to create them automatically."))
+ self._createNewButton = Gtk.LinkButton(uri="", label=_("_Click here to create them automatically."))
label = self._createNewButton.get_children()[0]
label.set_alignment(0, 0.5)
label.set_hexpand(True)
@@ -303,33 +298,23 @@ class CreateNewPage(Page):
self._createNewButton.connect("activate-link", lambda *args: Gtk.true())
self._createBox.attach(self._createNewButton, 1, 1, 1, 1)
- dot = Gtk.Label("•")
- dot.set_alignment(0.5, 0)
- dot.set_hexpand(False)
+ dot = Gtk.Label(label="•", xalign=0.5, yalign=0, hexpand=False)
self._createBox.attach(dot, 0, 2, 1, 1)
- label = Gtk.Label(_("Create new mount points by clicking the '+' button."))
- label.set_alignment(0, 0.5)
- label.set_hexpand(True)
- label.set_line_wrap(True)
+ label = Gtk.Label(label=_("Create new mount points by clicking the '+' button."),
+ xalign=0, yalign=0.5, hexpand=True, wrap=True)
self._createBox.attach(label, 1, 2, 1, 1)
if partitionsToReuse:
- dot = Gtk.Label("•")
- dot.set_alignment(0.5, 0)
- dot.set_hexpand(False)
+ dot = Gtk.Label(label="•", xalign=0.5, yalign=0, hexpand=False)
self._createBox.attach(dot, 0, 3, 1, 1)
- label = Gtk.Label(_("Or, assign new mount points to existing partitions after selecting them below."))
- label.set_alignment(0, 0.5)
- label.set_hexpand(True)
- label.set_line_wrap(True)
+ label = Gtk.Label(label=_("Or, assign new mount points to existing partitions after selecting them below."),
+ xalign=0, yalign=0.5, hexpand=True, wrap=True)
self._createBox.attach(label, 1, 3, 1, 1)
- label = Gtk.Label(_("_New mount points will use the following partitioning scheme:"))
- label.set_alignment(0, 0.5)
- label.set_line_wrap(True)
- label.set_use_underline(True)
+ label = Gtk.Label(label=_("_New mount points will use the following partitioning scheme:"),
+ xalign=0, yalign=0.5, wrap=True, use_underline=True)
self._createBox.attach(label, 0, 4, 2, 1)
label.set_mnemonic_widget(combo)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 609c498..7fec296 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -1135,11 +1135,8 @@ class SecretAgentDialog(GUIObject):
grid.set_column_spacing(6)
for row, secret in enumerate(self._content['secrets']):
- label = Gtk.Label(secret['label'])
- label.set_halign(Gtk.Align.START)
- entry = Gtk.Entry()
- entry.set_visibility(False)
- entry.set_hexpand(True)
+ label = Gtk.Label(label=secret['label'], halign=Gtk.Align.START)
+ entry = Gtk.Entry(visibility=False, hexpand=True)
self._validate(entry, secret)
entry.connect("changed", self._validate, secret)
entry.connect("activate", self._password_entered_cb)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 424a98a..bc4694b 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -278,19 +278,15 @@ class SoftwareSelectionSpoke(NormalSpoke):
def _add_row(self, listbox, name, desc, button):
row = Gtk.ListBoxRow()
- box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
- box.set_spacing(6)
+ box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6)
button.set_valign(Gtk.Align.START)
button.connect("clicked", self.on_button_toggled, row)
box.add(button)
- label = Gtk.Label()
- label.set_line_wrap(True)
- label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
- label.set_markup("<b>%s</b>\n%s" % (escape_markup(name), escape_markup(desc)))
- label.set_hexpand(True)
- label.set_alignment(0, 0.5)
+ label = Gtk.Label(label="<b>%s</b>\n%s" % (escape_markup(name), escape_markup(desc)),
+ use_markup=True, wrap=True, wrap_mode=Pango.WrapMode.WORD_CHAR,
+ hexpand=True, xalign=0, yalign=0.5)
box.add(label)
row.add(box)
--
1.8.5.3
10 years, 3 months
[master/rhel7] Set ThreadManager.any_errors to be a property (#1066467)
by David Shea
---
pyanaconda/threads.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/pyanaconda/threads.py b/pyanaconda/threads.py
index aebd7f8..8cde861 100644
--- a/pyanaconda/threads.py
+++ b/pyanaconda/threads.py
@@ -136,6 +136,7 @@ class ThreadManager(object):
"""
return self._errors.get(name)
+ @property
def any_errors(self):
"""Return True of there have been any errors in any threads
"""
--
1.8.5.3
10 years, 3 months
[rhel7-branch] kickstart block device resolution (#1047338)
by David Lehman
Basically, anywhere we were using udev_resolve_devspec or
DeviceTree.getDeviceByName we can gain a great deal of power by
instead using DeviceTree.resolveDevice. It can handle device names,
labels, UUIDs, it accounts for pending changes, and it can resolve
MD and DM devices by name (which udev_resolve_devspec cannot do).
I removed the loop that tries to prepend "mapper/" on disk names
because it isn't necessary and it also doesn't do anything useful.
(It raises an exception in the first iteration if it doesn't find
the disk instead of continuing on to try the other name.)
I could trim this down to the base bones for rhel7-branch if
necessary. That would be chunks 3, 5, and the piece of chunk 4
that switches from using getDeviceByName to resolveDevice.
10 years, 3 months