[anaconda][master][PATCH] Clear the default titlebar text
by Martin Kolman
By default the Anaconda/Initial Setup window titlebar (when it is visible)
displays __init__.py in the titlebar (name of the file where the GTK Window
class is instantiated). This looks ugly and is not really needed as we
always have a in-window title for all windows, so just set the titlebar text
to an empty string.
---
pyanaconda/ui/gui/__init__.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index b775a54..7feb4c3 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -281,6 +281,12 @@ class MainWindow(Gtk.Window):
# needed to interact with the window manager, like the GNOME top bar.
self.set_hide_titlebar_when_maximized(True)
+ # The Anaconda and Initial Setup windows might sometimes get decorated with
+ # a titlebar which contains the __init__.py header text by default.
+ # As all Anaconda and Initial Setup usually have a very distinct title text
+ # inside the window, the titlebar text is redundant and should be disabled.
+ self.set_title("")
+
# Treat an attempt to close the window the same as hitting quit
self.connect("delete-event", self._on_delete_event)
--
2.1.0
9 years, 3 months
[initial-setup][master][PATCH 0/2] Improve the README
by Martin Kolman
Fix the upstream repo address and add a .rst extension.
Martin Kolman (2):
Update the link to the upstream source code repository
Add the rst suffix to the README file
README | 57 ---------------------------------------------------------
README.rst | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 57 insertions(+), 57 deletions(-)
delete mode 100644 README
create mode 100644 README.rst
--
2.1.0
9 years, 3 months
[initial-setup][master][PATCH] Remove unneeded dependencies
by Martin Kolman
Initial Setup definitely does not need gtk-doc or development
files for GI during package build. Also the gi.repository
module is only used for importing gdk, so it should be pulled
in by the gtk dependency and doe not need to be explicitly listed.
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
initial-setup.spec | 3 ---
1 file changed, 3 deletions(-)
diff --git a/initial-setup.spec b/initial-setup.spec
index fc0d2e9..aa33707 100644
--- a/initial-setup.spec
+++ b/initial-setup.spec
@@ -23,10 +23,7 @@ BuildRequires: python-setuptools
BuildRequires: python-nose
BuildRequires: systemd-units
BuildRequires: gtk3-devel
-BuildRequires: gtk-doc
-BuildRequires: gobject-introspection-devel
BuildRequires: glade-devel
-BuildRequires: pygobject3
BuildRequires: anaconda >= %{anacondaver}
BuildRequires: python-di
--
2.1.0
9 years, 3 months
[libblockdev port follow-up][PATCH] Catch GLib.Error where LVM/Crypto/...Error instances were caught
by Vratislav Podzimek
GObject introspection raises an exception if GError is set by BlockDev.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
blivet/devices/lvm.py | 4 ++--
blivet/devicetree.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
index 5505bca..0e60eae 100644
--- a/blivet/devices/lvm.py
+++ b/blivet/devices/lvm.py
@@ -24,7 +24,7 @@ from six import add_metaclass
import abc
import pprint
import re
-from gi.repository import BlockDev
+from gi.repository import BlockDev, GLib
# device backend modules
from ..devicelibs import lvm
@@ -643,7 +643,7 @@ class LVMLogicalVolumeDevice(DMDevice):
try:
vg_info = BlockDev.lvm_vginfo(self.vg.name)
- except errors.LVMError as lvmerr:
+ except (errors.LVMError, GLib.GError) as lvmerr:
log.error("Failed to get free space for the %s VG: %s", self.vg.name, lvmerr)
# nothing more can be done, we don't know the VG's free space
return
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 78d7067..c751d92 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -1337,7 +1337,7 @@ class DeviceTree(object):
device.format.passphrase = passphrase
try:
device.format.setup()
- except CryptoError:
+ except (CryptoError, GLib.GError):
device.format.passphrase = None
else:
break
--
2.1.0
9 years, 3 months
[anaconda][master][PATCH] Move the pygobject3 dependency to the core package (#1188850)
by Martin Kolman
The pygobject3 package which provides the gi.repository Python module is
also used by non-UI code, so move the dependency to the core package.
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
anaconda.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 03e05d5..da4ca09 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -141,6 +141,7 @@ Requires: hfsplus-tools
%endif
Requires: python-coverage
+Requires: pygobject3
# required because of the rescue mode and VNC question
Requires: anaconda-tui = %{version}-%{release}
@@ -193,7 +194,6 @@ This package contains textual user interface for the Anaconda installer.
%package widgets
Summary: A set of custom GTK+ widgets for use with anaconda
Group: System Environment/Libraries
-Requires: pygobject3
Requires: python
%description widgets
--
2.1.0
9 years, 3 months
[PATCH] If a VM isn't going to finish in 60 minutes, it likely isn't going to finish.
by Chris Lumens
While I'm at it, make the logging output a little easier to read with some more
newlines, and add a TEST_JOBS environment variable that lets you specify how
many VMs to run at a time.
---
tests/gui/make_livecd.sh | 3 ++-
tests/kickstart_tests/run_kickstart_tests.sh | 21 ++++++++++++++-------
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/tests/gui/make_livecd.sh b/tests/gui/make_livecd.sh
index 2679021..045ca84 100755
--- a/tests/gui/make_livecd.sh
+++ b/tests/gui/make_livecd.sh
@@ -85,6 +85,7 @@ livemedia-creator --make-iso \
--lorax-templates ${TEMPLATES} \
--ram 2048 \
--vcpus 2 \
- --kernel-args nomodeset
+ --kernel-args nomodeset \
+ --timeout 30
rm livecd.ks
rm -r ${TEMPLATES}
diff --git a/tests/kickstart_tests/run_kickstart_tests.sh b/tests/kickstart_tests/run_kickstart_tests.sh
index c6880bb..8b076f3 100755
--- a/tests/kickstart_tests/run_kickstart_tests.sh
+++ b/tests/kickstart_tests/run_kickstart_tests.sh
@@ -67,8 +67,10 @@ runone() {
name=$(basename ${t%.sh})
+ echo
+ echo ============================================================
echo ${ks}
- echo ==============================
+ echo ============================================================
# qemu user needs to be able to read the directory.
tmpdir=$(mktemp -d --tmpdir=/var/tmp kstest-${name}.XXXXXXXX)
@@ -98,7 +100,8 @@ runone() {
--releasever 22 \
--ram 2048 \
--vcpus 2 \
- --vnc vnc
+ --vnc vnc \
+ --timeout 60
if [[ $? != 0 ]]; then
echo $(grep CRIT ${tmpdir}/virt-install.log)
cleanup ${tmpdir}
@@ -108,8 +111,13 @@ runone() {
img=$(grep disk_img ${tmpdir}/livemedia.log | cut -d= -f2)
trimmed=${img## }
- if [[ ! -f ${trimmed} ]]; then
- echo Disk image ${trimmed} does not exist.
+ if [[ $(grep "due to timeout" ${tmpdir}/livemedia.log) != "" ]]; then
+ echo FAILED - Test timed out.
+ cleanup ${tmpdir}
+ unset kernel_args prep validate
+ return 1
+ elif [[ ! -f ${trimmed} ]]; then
+ echo FAILED - Disk image ${trimmed} does not exist.
cleanup ${tmpdir}
unset kernel_args prep validate
return 1
@@ -117,8 +125,7 @@ runone() {
result=$(validate ${trimmed})
if [[ $? != 0 ]]; then
- echo "${result}"
- echo FAILED
+ echo FAILED - "${result}"
cleanup ${tmpdir}
unset kernel_args prep validate
return 1
@@ -136,4 +143,4 @@ export -f cleanup runone
# Round up all the kickstart tests we want to run, skipping those that are not
# executable as well as this file itself.
find kickstart_tests -name '*sh' -a -perm -o+x -a \! -wholename 'kickstart_tests/run_kickstart_tests.sh' | \
-parallel --jobs 2 runone {}
+parallel --jobs ${TEST_JOBS:-2} runone {}
--
2.2.2
9 years, 4 months
[rhel6-branch] Prevent anaconda from crashing due to repeated calls to rpmReadConfigFiles. (#1021534)
by Samantha N. Bueno
explodeRPM() in rpmextract.c is calling rpmReadConfigFiles() once per
every package processed without ever calling rpmFreeRpmrc() to free up
the resources, eventually causing anaconda to explode; so, avoid the
issue by only calling rmReadConfigFiles if the rpm has already been
initialized.
Thanks to Panu Matilainen <pmatilai(a)redhat.com> for the patch.
Resolves: rhbz#1021534
---
loader/rpmextract.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/loader/rpmextract.c b/loader/rpmextract.c
index 7054c5f..3da8b22 100644
--- a/loader/rpmextract.c
+++ b/loader/rpmextract.c
@@ -122,6 +122,7 @@ int explodeRPM(const char *source,
rpmts ts;
rpmVSFlags vsflags;
const char *compr;
+ static int rpm_initialized = 0;
int packageflags = 0;
@@ -135,7 +136,10 @@ int explodeRPM(const char *source,
logMessage(ERROR, "%s: %s\n", srcname, Fstrerror(fdi));
return EXIT_FAILURE;
}
- rpmReadConfigFiles(NULL, NULL);
+ if (!rpm_initialized) {
+ rpmReadConfigFiles(NULL, NULL);
+ rpm_initialized = 1;
+ }
/* Initialize RPM transaction */
ts = rpmtsCreate();
--
1.9.3
9 years, 4 months
[PATCH] Check parent/container type for thin volumes and normal volumes.
by David Lehman
---
blivet/devices/lvm.py | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
index d1817dd..1c72c86 100644
--- a/blivet/devices/lvm.py
+++ b/blivet/devices/lvm.py
@@ -440,6 +440,7 @@ class LVMLogicalVolumeDevice(DMDevice):
_type = "lvmlv"
_resizable = True
_packages = ["lvm2"]
+ _containerClass = LVMVolumeGroupDevice
def __init__(self, name, parents=None, size=None, uuid=None,
copies=1, logSize=None, segType=None,
@@ -480,14 +481,17 @@ class LVMLogicalVolumeDevice(DMDevice):
:type percent: int
"""
- if self.__class__.__name__ == "LVMLogicalVolumeDevice":
- if isinstance(parents, list):
- if len(parents) != 1:
- raise ValueError("constructor requires a single LVMVolumeGroupDevice instance")
- elif not isinstance(parents[0], LVMVolumeGroupDevice):
- raise ValueError("constructor requires a LVMVolumeGroupDevice instance")
- elif not isinstance(parents, LVMVolumeGroupDevice):
- raise ValueError("constructor requires a LVMVolumeGroupDevice instance")
+ if isinstance(parents, list):
+ if len(parents) != 1:
+ raise ValueError("constructor requires a single %s instance" % self._containerClass.__name__)
+
+ container = parents[0]
+ else:
+ container = parents
+
+ if not isinstance(container, self._containerClass):
+ raise ValueError("constructor requires a %s instance" % self._containerClass.__name__)
+
DMDevice.__init__(self, name, size=size, fmt=fmt,
sysfsPath=sysfsPath, parents=parents,
exists=exists)
@@ -1093,6 +1097,7 @@ class LVMThinPoolDevice(LVMLogicalVolumeDevice):
class LVMThinLogicalVolumeDevice(LVMLogicalVolumeDevice):
""" An LVM Thin Logical Volume """
_type = "lvmthinlv"
+ _containerClass = LVMThinPoolDevice
@property
def pool(self):
--
1.9.3
9 years, 4 months
[PATCH] livemedia-creator: Add --timeout option to cancel install after X minutes
by Brian C. Lane
Installations sometimes get stuck. This adds the option to cancel it
after some number of minutes have passed.
---
src/sbin/livemedia-creator | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator
index 0301c79..21c66d2 100755
--- a/src/sbin/livemedia-creator
+++ b/src/sbin/livemedia-creator
@@ -32,6 +32,7 @@ import subprocess
import socket
import threading
import SocketServer
+import time
from time import sleep
import shutil
import argparse
@@ -181,6 +182,9 @@ class LogServer(SocketServer.TCPServer):
self.log_error = False
self.error_line = ""
self.log_path = log_path
+ self._timeout = kwargs.pop("timeout", None)
+ if self._timeout:
+ self._start_time = time.time()
SocketServer.TCPServer.__init__(self, *args, **kwargs)
def log_check(self):
@@ -190,7 +194,13 @@ class LogServer(SocketServer.TCPServer):
:returns: True if there has been an error
:rtype: bool
"""
- return self.log_error
+ if self._timeout:
+ taking_too_long = time.time() > self._start_time + (self._timeout * 60)
+ if taking_too_long:
+ log.error("Canceling installation due to timeout")
+ else:
+ taking_too_long = False
+ return self.log_error or taking_too_long
class LogMonitor(object):
@@ -200,7 +210,7 @@ class LogMonitor(object):
This needs to be running before the virt-install runs, it expects
there to be a listener on the port used for the virtio log port.
"""
- def __init__(self, log_path=None, host="localhost", port=0):
+ def __init__(self, log_path=None, host="localhost", port=0, timeout=None):
"""
Start a thread to monitor the logs.
@@ -214,7 +224,7 @@ class LogMonitor(object):
If log_path isn't set then it only monitors the logs, instead of
also writing them to disk.
"""
- self.server = LogServer(log_path, (host, port), LogRequestHandler)
+ self.server = LogServer(log_path, (host, port), LogRequestHandler, timeout=timeout)
self.host, self.port = self.server.server_address
self.log_path = log_path
self.server_thread = threading.Thread(target=self.server.handle_request)
@@ -389,7 +399,6 @@ class VirtualInstall(object):
# TODO: If vnc has been passed, we should look up the port and print that
# for the user at this point
-
while dom.isActive() and not log_check():
sys.stdout.write(".")
sys.stdout.flush()
@@ -815,7 +824,7 @@ def novirt_install(opts, disk_img, disk_size, repo_url):
# Create the sparse image
mksparse(disk_img, disk_size * 1024**2)
- log_monitor = LogMonitor()
+ log_monitor = LogMonitor(timeout=opts.timeout)
args += ["--remotelog", "%s:%s" % (log_monitor.host, log_monitor.port)]
# Make sure anaconda has the right product and release
@@ -902,7 +911,7 @@ def virt_install(opts, install_log, disk_img, disk_size):
image and then optionally, based on the opts passed, creates tarfile.
"""
iso_mount = IsoMountpoint(opts.iso, opts.location)
- log_monitor = LogMonitor(install_log)
+ log_monitor = LogMonitor(install_log, timeout=opts.timeout)
kernel_args = ""
if opts.kernel_args:
@@ -941,7 +950,11 @@ def virt_install(opts, install_log, disk_img, disk_size):
iso_mount.umount()
if log_monitor.server.log_check():
- raise InstallError("virt_install failed on line: %s" % log_monitor.server.error_line)
+ if not log_monitor.server.error_line and opts.timeout:
+ msg = "virt_install failed due to timeout"
+ else:
+ msg = "virt_install failed on line: %s" % log_monitor.server.error_line
+ raise InstallError(msg)
if opts.make_fsimage:
make_fsimage(diskimg_path, disk_img, disk_size, label=opts.fs_label)
@@ -1252,6 +1265,8 @@ def main():
parser.add_argument("--volid", default=None, help="volume id")
parser.add_argument("--squashfs_args",
help="additional squashfs args")
+ parser.add_argument("--timeout", default=None, type=int,
+ help="Cancel installer after X minutes")
opts = parser.parse_args()
--
2.1.0
9 years, 4 months