[blivet:master] Add likely to be raised exceptions to catch block (#1150174)
by Anne Mulhern
Resolves: fed#1150174
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
blivet/devices/storage.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py
index 28a9d4f..6fb8a63 100644
--- a/blivet/devices/storage.py
+++ b/blivet/devices/storage.py
@@ -297,7 +297,12 @@ class StorageDevice(Device):
try:
udev_device = pyudev.Device.from_device_file(udev.global_udev,
self.path)
- except pyudev.DeviceNotFoundError as e:
+
+ # from_device_file() does not process exceptions but just propagates
+ # ValueErrors and EnvironmentErrors that may be raised. So catch
+ # those errors, but also catch DeviceNotFoundError, which is the
+ # appropriate exception and which it may raise in future.
+ except (pyudev.DeviceNotFoundError, EnvironmentError, ValueError) as e:
log.error("failed to update sysfs path for %s: %s", self.name, e)
self.sysfsPath = ''
else:
--
1.9.3
9 years, 7 months
[blivet] clean up blacklisting of specialized devices
by David Lehman
These are not ever relevant during OS installation. Ignore them at a
low level so they never make it into the devicetree.
There will be an accompanying patch to anaconda to stop marking zram
devices as protected.
9 years, 7 months
[anaconda][rhel7-branch/master][PATCH] Use the /usr/share/anaconda/help for help content (#1072033)
by Martin Kolman
Turns out we can't use /usr/share/doc/anaconda/help because during
image generation the RPM transaction is running with nodocs and
all docs are removed.
Related: rhbz#1072033
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
anaconda.spec.in | 2 +-
data/help/en-US/Makefile.am | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 2f1f77d..5511ca4 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -254,7 +254,7 @@ update-desktop-database &> /dev/null || :
%{_sbindir}/anaconda
%{_sbindir}/handle-sshpw
%{_datadir}/anaconda
-%{_datadir}/doc/anaconda/*
+%{_datadir}/anaconda/help/*
%exclude %{_datadir}/anaconda/tzmapdata
%{_prefix}/libexec/anaconda
%{_libdir}/python*/site-packages/pyanaconda/*
diff --git a/data/help/en-US/Makefile.am b/data/help/en-US/Makefile.am
index 0b46f4a..b7aa1bc 100644
--- a/data/help/en-US/Makefile.am
+++ b/data/help/en-US/Makefile.am
@@ -17,7 +17,7 @@
#
# Author: Martin Kolman <mkolman(a)redhat.com>
-enplaceholderdir = $(docdir)/en-US
+enplaceholderdir = $(datadir)/anaconda/help/en-US
dist_enplaceholder_DATA = FedoraPlaceholder.html FedoraPlaceholderWithLinks.html RHEL7Placeholder.html RHEL7PlaceholderWithLinks.html
MAINTAINERCLEANFILES = Makefile.in
--
1.9.3
9 years, 7 months
[master] Remove the last references to tzmapdata
by David Shea
---
anaconda.spec.in | 1 -
widgets/src/Makefile.am | 4 +---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index ccb712f..d63282c 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -268,7 +268,6 @@ update-desktop-database &> /dev/null || :
%{_sbindir}/anaconda
%{_sbindir}/handle-sshpw
%{_datadir}/anaconda
-%exclude %{_datadir}/anaconda/tzmapdata
%{_prefix}/libexec/anaconda
%{_libdir}/python*/site-packages/pyanaconda/*
%exclude %{_libdir}/python*/site-packages/pyanaconda/rescue.py*
diff --git a/widgets/src/Makefile.am b/widgets/src/Makefile.am
index 42615c2..f6584dd 100644
--- a/widgets/src/Makefile.am
+++ b/widgets/src/Makefile.am
@@ -56,14 +56,12 @@ SOURCES = $(GISOURCES) $(NONGISOURCES)
HDRS = $(GIHDRS) $(NONGIHDRS)
WIDGETSDATA = '"$(datadir)/anaconda"'
-TZMAPDATA = '"tzmapdata"'
noinst_HEADERS = gettext.h intl.h
lib_LTLIBRARIES = libAnacondaWidgets.la
libAnacondaWidgets_la_CFLAGS = $(GTK_CFLAGS) $(GLADEUI_CFLAGS) $(LIBXKLAVIER_CFLAGS) -Wall -g\
- -DWIDGETS_DATADIR=$(WIDGETSDATA)\
- -DTZMAP_DATADIR=$(TZMAPDATA)
+ -DWIDGETS_DATADIR=$(WIDGETSDATA)
libAnacondaWidgets_la_LIBADD = $(GTK_LIBS) $(GLADEUI_LIBS) $(LIBXKLAVIER_LIBS)
libAnacondaWidgets_la_LDFLAGS = $(LTLIBINTL) -version-info 3:0:1
libAnacondaWidgets_la_SOURCES = $(SOURCES) $(HDRS) \
--
2.1.0
9 years, 7 months
[master/f21-branch] Filter out iso9660 devices from disk list (#874381)
by Brian C. Lane
When installing from a USB device written with dd the device format type
is iso9660, but it is also partitioned. Blivet filters out the
partitions but Anaconda was still showing the device in the storage
spoke.
---
pyanaconda/ui/lib/disks.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/lib/disks.py b/pyanaconda/ui/lib/disks.py
index 9d4607f..0fb8f3f 100644
--- a/pyanaconda/ui/lib/disks.py
+++ b/pyanaconda/ui/lib/disks.py
@@ -48,7 +48,7 @@ class FakeDisk(object):
def getDisks(devicetree, fake=False):
if not fake:
- devices = devicetree.devices
+ devices = filter(lambda d: d.format.type != "iso9660", devicetree.devices)
if flags.imageInstall:
hidden_images = [d for d in devicetree._hidden \
if d.name in devicetree.diskImages]
--
1.9.3
9 years, 7 months
[PATCH rhel7-branch] Take "RHEL Atomic Host" as rhel installclass.
by Radek Vykydal
Atomic is using this product name that does not match "Red Hat " prefix,
due to lorax length limita on the name (32 chars?).
In near future we'll want to configure different default autopartitioning for
Atomic. I'm inclined to do it by updating fedora and rhel installclasses for
atomic case. If we wanted to go more classy, perhaps using mixin would be ok.
Maybe we'll need to rework installclasses for other new products anyway, Seems
like a place deserving clever cleanup.
---
pyanaconda/installclasses/rhel.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/installclasses/rhel.py b/pyanaconda/installclasses/rhel.py
index b1e4375..de5608d 100644
--- a/pyanaconda/installclasses/rhel.py
+++ b/pyanaconda/installclasses/rhel.py
@@ -29,7 +29,7 @@ class InstallClass(BaseInstallClass):
id = "rhel"
name = N_("Red Hat Enterprise Linux")
sortPriority = 20000
- if not productName.startswith("Red Hat "):
+ if not productName.startswith(("Red Hat ", "RHEL Atomic")):
hidden = 1
defaultFS = "xfs"
--
1.9.3
9 years, 7 months
[blivet:master 00/10] Consistency in RAID level related checks (v2)
by Anne Mulhern
Everything is the same bar recommended changes except for
* Adjust detection of exception raised (the regular expressions were too broad)
* The final five patches, which refactor testing infrastructure for devices
and add some new tests to test setting dataLevel and metadataLevel in BTRFS.
Note: I'ld rather keep the RaidDevice class separate for now.
It's a lightweight class with no state of its own or constructor. If we
want to make it extend ContainerDevice at a later time, we can.
mulhern (10):
Do not set parents attribute if parents param is bad.
Add new RaidDevice class for handling RAID aspects of devices.
Use new RaidDevice class in appropriate Device subclasses.
Update test setup so that it obeys RAID level requirements.
Adjust detection of exceptions raised.
Move getting the attribute into the check methods.
Refactor setup of _state_functions into __init__() methods
Add isleaf and direct to _state_functions
Add dataLevel and metaDataLevel attributes for testing.
Add a few test for setting dataLevel and metaDataLevel in BTRFS
blivet/devices/btrfs.py | 67 +++---
blivet/devices/device.py | 6 +-
blivet/devices/md.py | 45 ++--
blivet/devices/raid.py | 106 +++++++++
tests/devicefactory_test.py | 8 +-
tests/devices_test.py | 518 ++++++++++++++++++++++++++++----------------
6 files changed, 493 insertions(+), 257 deletions(-)
create mode 100644 blivet/devices/raid.py
--
1.9.3
9 years, 7 months
[blivet:master 0/5] Consistency in RAID level related checks
by Anne Mulhern
The idea is to try to be consistent between various device types which use
RAID when setting RAID level or updating various other bits of state that
could invalidate RAID level.
The first patch is a simple cleanup.
The next two are the main bits of the change.
The last two update tests appropriately.
mulhern (5):
Do not set parents attribute if parents param is bad.
Add new RaidDevice class for handling RAID aspects of devices.
Use new RaidDevice class in appropriate Device subclasses.
Update test setup so that it obeys RAID level requirements.
Adjust detection of exceptions raised.
blivet/devices/btrfs.py | 57 ++++++----------
blivet/devices/device.py | 6 +-
blivet/devices/md.py | 45 +++++++------
blivet/devices/raid.py | 106 +++++++++++++++++++++++++++++
tests/devicefactory_test.py | 8 ++-
tests/devices_test.py | 161 ++++++++++++++++++++++++++++++++++----------
6 files changed, 285 insertions(+), 98 deletions(-)
create mode 100644 blivet/devices/raid.py
--
1.9.3
9 years, 7 months
[lorax][rhel7-branch/master][PATCH] Libgailutil is required yelp, don't remove it (#1072033)
by Martin Kolman
Related: rhbz#1072033
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
share/runtime-cleanup.tmpl | 1 -
1 file changed, 1 deletion(-)
diff --git a/share/runtime-cleanup.tmpl b/share/runtime-cleanup.tmpl
index f154bf1..6cf195c 100644
--- a/share/runtime-cleanup.tmpl
+++ b/share/runtime-cleanup.tmpl
@@ -213,7 +213,6 @@ removefrom gstreamer /usr/bin/* /usr/${libdir}/gstreamer-0.10/*
removefrom gstreamer /usr/${libdir}/libgst* /usr/libexec/* /usr/share/locale/*
removefrom gtk2 /usr/bin/update-gtk-immodules
removefrom gtk3 /usr/${libdir}/gtk-3.0/*
-removefrom gtk3 /usr/${libdir}/libgailutil*
removefrom gzip /usr/bin/{gzexe,zcmp,zdiff,zegrep,zfgrep,zforce,zgrep,zless,zmore,znew}
removefrom hwdata /etc/* /usr/share/hwdata/oui.txt /usr/share/hwdata/pnp.ids
removefrom hwdata /usr/share/hwdata/upgradelist
--
1.9.3
9 years, 7 months
[master/f21/rhel7-branch] s390x: show dialog if kernel cmdline in zipl.conf is too long. (#885011)
by Samantha N. Bueno
On s390x, the kernel cmdline has a hard limit of 896 bytes in length.
There is nothing we can do to circumvent this, so instead of just
crashing, handle the error gracefully by showing an error window and
telling the user they need to reboot.
Resolves: rhbz#885011
---
pyanaconda/bootloader.py | 8 ++++++--
pyanaconda/errors.py | 15 ++++++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 4832c49..3264e98 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -36,6 +36,7 @@ from pyanaconda.flags import flags
from blivet.errors import StorageError
from blivet.fcoe import fcoe
import pyanaconda.network
+from pyanaconda.errors import errorHandler, ERROR_RAISE
from pyanaconda.packaging.rpmostreepayload import RPMOSTreePayload
from pyanaconda.nm import nm_device_hwaddress
from blivet import platform
@@ -2158,6 +2159,11 @@ class ZIPL(BootLoader):
# We want to extract the device name and pass that.
name = re.sub(r".+?: ", "", line)
self.stage1_name = re.sub(r"(\s\(.+\))?\.$", "", name)
+ # a limitation of s390x is that the kernel parameter list must not
+ # exceed 896 bytes; there is nothing we can do about this, so just
+ # catch the error and show it to the user instead of crashing
+ elif line.startswith("Error: The length of the parameters "):
+ errorHandler.cb(ZIPLError(line))
if not self.stage1_name:
raise BootLoaderError("could not find IPL device")
@@ -2370,8 +2376,6 @@ def writeSysconfigKernel(storage, version):
def writeBootLoaderFinal(storage, payload, instClass, ksdata):
""" Do the final write of the bootloader. """
- from pyanaconda.errors import errorHandler, ERROR_RAISE
-
# set up dracut/fips boot args
# XXX FIXME: do this from elsewhere?
storage.bootloader.set_boot_args(storage=storage,
diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py
index 1541c46..e2da7f1 100644
--- a/pyanaconda/errors.py
+++ b/pyanaconda/errors.py
@@ -49,6 +49,9 @@ class PasswordCryptError(Exception):
Exception.__init__(self)
self.algo = algo
+class ZIPLError(Exception):
+ pass
+
# These constants are returned by the callback in the ErrorHandler class.
# Each represents a different kind of action the caller can take:
#
@@ -257,6 +260,15 @@ class ErrorHandler(object):
self.ui.showError(message)
return ERROR_RAISE
+ def _ziplErrorHandler(self, *args, **kwargs):
+ details = kwargs["exception"]
+ message = _("Installation was stopped due to an error installing the "
+ "boot loader. The exact error message is:\n\n%s\n\n"
+ "The installer will now terminate.") % details
+
+ self.ui.showError(message)
+ return ERROR_RAISE
+
def cb(self, exn, *args, **kwargs):
"""This method is the callback that all error handling should pass
through. The return value is one of the ERROR_* constants defined
@@ -290,7 +302,8 @@ class ErrorHandler(object):
"ScriptError": self._scriptErrorHandler,
"PayloadInstallError": self._payloadInstallHandler,
"DependencyError": self._dependencyErrorHandler,
- "PasswordCryptError": self._passwordCryptErrorHandler}
+ "PasswordCryptError": self._passwordCryptErrorHandler,
+ "ZIPLError": self._ziplErrorHandler}
if exn.__class__.__name__ in _map:
kwargs["exception"] = exn
--
1.9.3
9 years, 7 months