[PATCH rhel6-branch] Increment MD container child counter even if its volumes are ignored (#1120640)
by Artur Paszkiewicz
Volumes which are not selected in Specialized Storage Devices are
ignored in addUdevDevice. This causes that their parent container
won't have its child counter incremented, which can later cause an
incorrect unusedRaidMembersWarning.
Resolves: rhbz#1120640
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz(a)intel.com>
---
storage/devicetree.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 4045cdf..b9ea399 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1328,6 +1328,13 @@ class DeviceTree(object):
# slice off the "/dev/" part, lvm filter cares only about the rest
partitions_paths = [p[5:] for p in partitions_paths]
map(lvm.lvm_cc_addFilterRejectRegexp, partitions_paths)
+
+ if udev_device_get_md_container(info):
+ parentName = devicePathToName(udev_device_get_md_container(info))
+ container = self.getDeviceByName(parentName)
+ if container:
+ container.addChild()
+
return
log.debug("scanning %s (%s)..." % (name, sysfs_path))
--
1.8.4.5
8 years, 2 months
[PATCH] v1.2 add nombr option to suppress MBR update with grub2
by Gene Czarcinski
This patch is in response to RHBZ#886502.
Add the capability to suppress updating the MBR but still have
the grub2 package installed and configured requires updating both
the anaconda and pykickstart packages.
An updates.img was created with an update pykickstart included.
Tested both nombr on the command line and --nombr as an option
on kickstart's bootloader command. The test used Fedora 21
Alpha RC1 netinstall.
Gene Czarcinski (2):
v1.2 add nombr to anaconda to suppress updating MBR
add the --nombr bootloader option in pykickstart
anaconda | 3 +++
data/anaconda_options.txt | 8 ++++++++
pyanaconda/bootloader.py | 6 ++++++
pyanaconda/flags.py | 3 ++-
pyanaconda/kickstart.py | 3 +++
5 files changed, 22 insertions(+), 1 deletion(-)
pykickstart/commands/bootloader.py | 10 ++++++++--
tests/commands/bootloader.py | 1 +
2 files changed, 9 insertions(+), 2 deletions(-)
--
1.9.3
9 years, 5 months
[master 00/17] Improve child process starting and management
by David Shea
The overall goal is to ensure that any time we start a new process, it should
be started with a clean set of signal handlers (in particular, make sure that
SIGPIPE is set to SIG_DFL instead of the SIG_IGN set by python) and no file
descriptors from the parent make it through exec() other than stdin, stdout and
stderr.
The first five are cleanups in the main anaconda script that I hope will be
uncontroversial, one of them obviously a typo that I pushed a couple weeks
ago. Oops.
Patches 6, 7, and 15 are related to the SIGCHLD handler. We don't want to throw
an exception if X or metacity exits before anaconda during a reboot, so clear
the watched process list in exitHandler. Patch 6 rearranges the anaconda script
in order to catch exceptions from watched processes, so we can do the ipmi
stuff when X crashes. Patch 15 moves the watch methods into iutil and modifies
them to use Popen objects instead of a custom fork-exec protocol.
The "Simplify iutil.execReadlines" patch we've discussed before, I've just
split the bits not directly related to execReadlines into separate commits and
expanded the commit message to hopefully explain and address the concerns from
last time. The rest of the patches are for creating a process starting
interface flexible enough for all of our process starts, and getting everyone
to use it.
I'm not real happy about patch 7, but I think we ought to do something in order
to send the ipmi report. Some discussion points:
- I went with raise instead of sys.exit because I thought it would be
unhelpful if anaconda rebooted in such a case. Is there something better
we could do?
- Should we catch Exception, instead? I don't think we do any ipmi stuff if
something crashes and we get a meh handler, but I'm not 100% sure about
that. ExitErrors will always be delivered to the main thread, but if we
catch Exception, would we need a handler in the threading module as well?
- None of this ever actually gets called, because gdk calls _exit(1) (!!)
when it loses the X connection. How do we work around that?
* If we override the error handlers with our own XSetErrorHandler and
XSetIOErrorHandler calls, there will still be a gap between Gdk init
and our calls where X could crash and cause anaconda to exit, also
having XLib calls in anaconda would be super gross
* If we launch the graphical stuff in a separate process that would be
medium gross
* If we ask the Gtk to not freaking exit in a library call they probably
won't
- Also how much of this stuff needs to go to rhel7-branch
David Shea (17):
Fix a typo in a comment
Import gettext in iutil instead of passing the module reference to
iutil
Import _ from the i18n module instead of hand-crafting a copy of it
Remove uses of the deprecated string.split method.
Remove the exitCode parameter from exitHandler.
Clear the list of watched PIDs before exiting.
Handle watched processes exiting.
Lock program_log_lock closer to where the log is written.
Add a method startProgram to handle process starting
Add an option to startProgram to reset signal handlers.
Add close_fds to the Popen call.
Simplify iutil.execReadlines.
Add an option to only capture stdout with execWithCapture
Close file descriptors while daemonizing auditd
Move process watching to iutil.
Move the X startup logic to iutil
Always use iutil to start processes.
anaconda | 384 ++++++++++----------------------
pyanaconda/anaconda_log.py | 4 +-
pyanaconda/ihelp.py | 4 +-
pyanaconda/isys/auditd.c | 5 +
pyanaconda/iutil.py | 373 ++++++++++++++++++++++++-------
pyanaconda/kickstart.py | 32 +--
pyanaconda/rescue.py | 4 +-
pyanaconda/ui/gui/spokes/network.py | 6 +-
pyanaconda/ui/tui/spokes/askvnc.py | 5 +-
pyanaconda/ui/tui/spokes/shell_spoke.py | 6 +-
pyanaconda/vnc.py | 14 +-
scripts/instperf | 3 +-
tests/pyanaconda_tests/iutil_test.py | 227 +++++++++++++++----
13 files changed, 615 insertions(+), 452 deletions(-)
--
1.9.3
9 years, 5 months
[blivet:master 0/2] Remove test which needs updating on btrfs-progs version change. (v3)
by Anne Mulhern
Rebased against most recent version of master and seems OK.
Originally my plan was just to get rid of the test that was failing on Jenkins,
since it did not test anything we use. But on further consideration, it
appeared that that was a mistake, i.e., we should be using that information.
So that's what this patch set does instead.
mulhern (2):
Further abstract loopbackedtestcase on block_size.
Check the minimum member size for BtrfsVolumeDevices.
blivet/devicelibs/btrfs.py | 4 ++++
blivet/devices.py | 10 +++++++++
tests/devicelibs_test/btrfs_test.py | 21 +++++++++++++++++-
tests/devicelibs_test/mdraid_interrogate_test.py | 5 +++--
tests/devicelibs_test/mdraid_test.py | 6 +++---
tests/devices_test.py | 26 +++++++++++++++++------
tests/formats_test/fslabeling.py | 3 ++-
tests/formats_test/selinux_test.py | 3 ++-
tests/loopbackedtestcase.py | 27 +++++++++++++++---------
9 files changed, 80 insertions(+), 25 deletions(-)
--
1.9.3
9 years, 6 months
[anaconda][rhel7-branch/master][PATCH] Autostep --austoscreenshot support for new-ui
by Martin Kolman
Autostep --autoscreenshot is back from the dead, stronger than ever before!
How does it work ?
* autostep is activated just before leaving a hub by capturing the continue-clicked signal
* it takes a screenshot of the hub and then iterates all spokes on the hub, taking screenshots
* once done, it emits the continue-clicked signal it "consumed" previously, so Anaconda can
switch to the next hub (or quit)
* the standard screenshot everything-on-the-screen code added for global screenshot support is used,
but was turned into a function
* the automatically taken screenshots have nice names
* if --autoscreenshot is not specified (don't ask me why would someone do that...) no screenshots are taken
and Anaconda just pointlessly steps through all screens
QA
Q: What about dialogs being spawned on apply/side effects of automatically visiting the spokes ?
A: While iterating over the spoke, autostep does not "press" the Done button but instead terminates the
recursive GTK main loop the spoke has & makes sure apply/execute are not called. So no dialogs & hopefully
also no other side effects.
Q: What about the Welcome spoke ?
A: It is for some reason present in the spoke dictionary of the summary hub, so its screenshot gets taken
together with the other spokes (this includes also Custom Partitioning and Advanced Storage BTW).
Q: Why is the patch removing the copy-screenshots post-script ?
A: The last batch of screenshots taken before leaving the Progress hub is taken after the post-scripts have run,
so the screenshots can't be copied by the post-scripts, but by Python code running just before Anaconda quits.
Q: Why is autostep running just before leaving a hub ?
A: Anaconda only leaves a hub after all spokes are ready, which is the ideal time to take their screenshot and
it also makes sure nothing will change in them. Running in the continue handler also makes it possible to support
incomplete kickstarts - the user just adds the missing info and clicks continue - and autostep can then do it's job,
just like if the kickstart was complete and the continue signal was emitted automatically.
Martin Kolman (1):
Add support for autostep and --autoscreenshot (#1059295)
data/post-scripts/90-copy-screenshots.ks | 10 ---
pyanaconda/constants.py | 4 +
pyanaconda/iutil.py | 23 ++++++
pyanaconda/ui/gui/__init__.py | 127 ++++++++++++++++++++++++++-----
pyanaconda/ui/gui/hubs/__init__.py | 43 +++++++++++
5 files changed, 179 insertions(+), 28 deletions(-)
delete mode 100644 data/post-scripts/90-copy-screenshots.ks
--
1.9.3
9 years, 6 months
[rhel7-branch] Thin pool profile specification in kickstart
by Vratislav Podzimek
The final goal for the bug #869456 is to add GUI support for specifying thin
pool profile, but I'd like you to have a chance to judge these building blocks
first.
Vratislav Podzimek (1):
Add support for thin pool profile specification in kickstart
pyanaconda/kickstart.py | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
--
1.9.3
9 years, 6 months
[blivet:master 0/3] size.py related patches
by Anne Mulhern
mulhern (3):
Rewrite of Size.humanReadable() method
Factor out commonalities in xlated_*_prefix() methods.
Use named constants for binary and decimal factors.
blivet/size.py | 162 ++++++++++++++++++++++++++++-------------------------
tests/size_test.py | 60 +++++++++++++++++++-
2 files changed, 143 insertions(+), 79 deletions(-)
--
1.9.3
9 years, 6 months
[anaconda][rhel7-branch][PATCH 0/2] Help for every screen
by Martin Kolman
This is the rhel7-branch version of the help patchset. A couple of things to note:
* I've left out the patches that bind the F1 key to trigger the help viewer for
the current screen + the custom mnemonics patches, as the mechanism used for this on master
does not exist on rhel7-branch and so these patches will most probably require some
quite extensive changes
* in the same spirit as how the master version of this patch set bumps the widgets version to 3.1,
I've bumped it to 1.1 for RHEL7 branch - is this correct & correctly done ?
* I've tested that the help buttons work correctly on the Welcome spoke, on the hub, in spokes and
even inside the KDUMP addon :)
* unfortunately this does not hold for the DATE & TIME spoke - once you enter it, you get black screen
and anaconda crashes hard (pane-is-dead hard) and there is this error message on TTY1:
(anaconda:1467): Glib-ERROR **: gmem.c:335: overflow allocating 18446744073709551615*18446744073709551615 bytes
- this error message does not show up when running without updates image & the DATE & TIME spoke does not crash,
so it is very likely related to the crash
- there is nothing related in the anaconda.log
- might this be related to the world-map widget & widgets versioning ?
- Any help with debugging this issue would be very appreciated, thanks in advance! :)
Martin Kolman (2):
Add a help button to every Anaconda screen
Specify help file names for hubs and spokes
anaconda.spec.in | 1 +
data/help/Makefile.am | 21 ++++
data/help/en-US/FedoraPlaceholder.html | 5 +
data/help/en-US/FedoraPlaceholderWithLinks.html | 13 +++
data/help/en-US/Makefile.am | 23 ++++
data/help/en-US/RHEL7Placeholder.html | 5 +
data/help/en-US/RHEL7PlaceholderWithLinks.html | 11 ++
pyanaconda/ihelp.py | 143 ++++++++++++++++++++++++
pyanaconda/installclass.py | 6 +
pyanaconda/installclasses/fedora.py | 3 +
pyanaconda/installclasses/rhel.py | 3 +
pyanaconda/ui/gui/__init__.py | 12 ++
pyanaconda/ui/gui/hubs/__init__.py | 4 +-
pyanaconda/ui/gui/hubs/progress.py | 1 +
pyanaconda/ui/gui/hubs/summary.py | 1 +
pyanaconda/ui/gui/spokes/__init__.py | 13 ++-
pyanaconda/ui/gui/spokes/custom.py | 1 +
pyanaconda/ui/gui/spokes/datetime_spoke.py | 1 +
pyanaconda/ui/gui/spokes/filter.py | 1 +
pyanaconda/ui/gui/spokes/keyboard.py | 1 +
pyanaconda/ui/gui/spokes/langsupport.py | 1 +
pyanaconda/ui/gui/spokes/network.py | 1 +
pyanaconda/ui/gui/spokes/password.py | 1 +
pyanaconda/ui/gui/spokes/software.py | 1 +
pyanaconda/ui/gui/spokes/source.py | 1 +
pyanaconda/ui/gui/spokes/storage.py | 1 +
pyanaconda/ui/gui/spokes/user.py | 1 +
pyanaconda/ui/gui/spokes/welcome.py | 1 +
scripts/makeupdates | 3 +
widgets/configure.ac | 4 +-
widgets/glade/AnacondaWidgets.xml | 7 +-
widgets/src/BaseWindow.c | 48 ++++++++
widgets/src/BaseWindow.h | 3 +
33 files changed, 337 insertions(+), 5 deletions(-)
create mode 100644 data/help/Makefile.am
create mode 100644 data/help/en-US/FedoraPlaceholder.html
create mode 100644 data/help/en-US/FedoraPlaceholderWithLinks.html
create mode 100644 data/help/en-US/Makefile.am
create mode 100644 data/help/en-US/RHEL7Placeholder.html
create mode 100644 data/help/en-US/RHEL7PlaceholderWithLinks.html
create mode 100644 pyanaconda/ihelp.py
--
1.9.3
9 years, 6 months
[blivet:f21-branch 00/14] #1147087 related patches
by Anne Mulhern
All but the last are cherry-picks from master.
When I posted the last patch for master/f2-branch,
I thought that the error that was seen was due to
the switch to pyudev. But, since it's in f21-branch that can not be the
case. Nonetheless, uncanonicalized UUIDs are somehow getting in, so the
best step is to canonicalize them on access from udev, which is what the last
patch does.
The last patch is for both master and f21-branch.
mulhern (14):
Add a docstring to mdraid.mdexamine
Factor canonicalize_UUID() into separate method.
Be more robust in the face of possible changes to mdadm's UUIDs.
Extend mdadm() to capture output
Add a method to extract information about an mdraid array
Refactor mdraid tests.
Split mdadd into separate functions.
Break once metadata value is found.
Fix mdnominate error message.
Use long messages for unittest errors.
Still attempt to destroy even if remove failed.
Add a test for mddetail on containers.
Add a test for activation.
Canonicalize MD_UUID* values in udev.py (#1147087)
blivet/devicelibs/mdraid.py | 125 +++++++++---
blivet/devices.py | 2 +-
blivet/udev.py | 5 +-
blivet/util.py | 20 ++
tests/devicelibs_test/mdraid_interrogate_test.py | 240 +++++++++++++++++++++++
tests/devicelibs_test/mdraid_test.py | 201 ++++++++++---------
6 files changed, 464 insertions(+), 129 deletions(-)
create mode 100755 tests/devicelibs_test/mdraid_interrogate_test.py
--
1.9.3
9 years, 6 months
[blivet:master/f21-branch] Catch up with pyudev changes that effect MD_UUID* values (#1147087)
by Anne Mulhern
Resolves: fed#1147087
On switching to pyudev, MD_UUID* were obtained, not from mdraid methods, but
from pyudev methods. Since these did not pass through the mdraid methods,
they were not canonicalized, leading to uncanonicalized forms being used for
lookup. Now, they are canonicalized on lookup in blivet.util.py. Since
the canonicalize_UUID method is shared, it is moved up into blivet.utils.py.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
blivet/devicelibs/mdraid.py | 19 +------------------
blivet/udev.py | 5 +++--
blivet/util.py | 20 ++++++++++++++++++++
3 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/blivet/devicelibs/mdraid.py b/blivet/devicelibs/mdraid.py
index cb36f32..3dc93da 100644
--- a/blivet/devicelibs/mdraid.py
+++ b/blivet/devicelibs/mdraid.py
@@ -22,7 +22,6 @@
import os
import re
-import uuid
from .. import util
from ..errors import MDRaidError
@@ -256,22 +255,6 @@ def mddeactivate(device):
except MDRaidError as msg:
raise MDRaidError("mddeactivate failed for %s: %s" % (device, msg))
-def canonicalize_UUID(a_uuid):
- """ Converts uuids to canonical form.
-
- :param str a_uuid: the UUID
-
- :returns: a canonicalized UUID
- :rtype: str
-
- mdadm's UUIDs are actual 128 bit uuids, but it formats them strangely.
- This converts the uuids to canonical form.
- Example:
- mdadm UUID: '3386ff85:f5012621:4a435f06:1eb47236'
- canonical UUID: '3386ff85-f501-2621-4a43-5f061eb47236'
- """
- return str(uuid.UUID(a_uuid.replace(':', '')))
-
def process_UUIDS(info, UUID_keys):
""" Extract and convert expected UUIDs to canonical form.
Reassign canonicalized UUIDs to corresponding keys.
@@ -284,7 +267,7 @@ def process_UUIDS(info, UUID_keys):
# extract mdadm UUID, e.g., '3386ff85:f5012621:4a435f06:1eb47236'
the_uuid = re.match(r"(([a-f0-9]){8}:){3}([a-f0-9]){8}", v)
- info[k] = canonicalize_UUID(the_uuid.group())
+ info[k] = util.canonicalize_UUID(the_uuid.group())
except (ValueError, AttributeError) as e:
# the unlikely event that mdadm's UUIDs change their format
log.warning('uuid value %s could not be canonicalized: %s', v, e)
diff --git a/blivet/udev.py b/blivet/udev.py
index df587b7..c8ee3db 100644
--- a/blivet/udev.py
+++ b/blivet/udev.py
@@ -349,7 +349,7 @@ def device_get_md_uuid(info):
# Value for MD_UUID known to be obtained from:
# * pyudev/libudev
# * mdraid/mdadm (all numeric metadata versions and container default)
- return info["MD_UUID"]
+ return util.canonicalize_UUID(info["MD_UUID"])
def device_get_md_container(info):
"""
@@ -396,7 +396,8 @@ def device_get_md_device_uuid(info):
# * mdraid/mdadm (only 1.x metadata versions)
# Value for ID_FS_UUID_SUB known to be obtained from:
# * pyudev/libudev
- return info.get('ID_FS_UUID_SUB') or info.get('MD_DEV_UUID')
+ md_device_uuid = info.get('ID_FS_UUID_SUB') or info.get('MD_DEV_UUID')
+ return util.canonicalize_UUID(md_device_uuid) if md_device_uuid else None
def device_get_vg_name(info):
return info['LVM2_VG_NAME']
diff --git a/blivet/util.py b/blivet/util.py
index 28dc125..ad61936 100644
--- a/blivet/util.py
+++ b/blivet/util.py
@@ -8,6 +8,7 @@ import subprocess
import re
import sys
import tempfile
+import uuid
from decimal import Decimal
from contextlib import contextmanager
@@ -362,6 +363,25 @@ class ObjectID(object):
self.id = self._newid_gen() # pylint: disable=attribute-defined-outside-init
return self
+def canonicalize_UUID(a_uuid):
+ """ Converts uuids to canonical form.
+
+ :param str a_uuid: the UUID
+
+ :returns: a canonicalized UUID
+ :rtype: str
+
+ mdadm's UUIDs are actual 128 bit uuids, but it formats them strangely.
+ This converts the uuids to canonical form.
+ Example:
+ mdadm UUID: '3386ff85:f5012621:4a435f06:1eb47236'
+ canonical UUID: '3386ff85-f501-2621-4a43-5f061eb47236'
+
+ If the UUID is already in canonical form, the conversion
+ is equivalent to the identity.
+ """
+ return str(uuid.UUID(a_uuid.replace(':', '')))
+
##
## Convenience functions for examples and tests
##
--
1.9.3
9 years, 6 months