[f21/master] Enter the progress hub with the spinner stopped (#1160484)
by David Shea
Workaround an issue with the progress hub not being able to draw
anything. Having a the spinner running when the hub is loaded seems too
much to handle in some environments, but deferring the spinner start to
the refresh call gets things to display. The problem is still evident by
the spinner itself failing to draw completely, but this is much less
severe a problem.
---
pyanaconda/ui/gui/hubs/progress.glade | 1 -
pyanaconda/ui/gui/hubs/progress.py | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/hubs/progress.glade b/pyanaconda/ui/gui/hubs/progress.glade
index f459ce0..f9a03eb 100644
--- a/pyanaconda/ui/gui/hubs/progress.glade
+++ b/pyanaconda/ui/gui/hubs/progress.glade
@@ -71,7 +71,6 @@
<object class="GtkSpinner" id="progressSpinner">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="active">True</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py
index 95883ba..0bc2dab 100644
--- a/pyanaconda/ui/gui/hubs/progress.py
+++ b/pyanaconda/ui/gui/hubs/progress.py
@@ -252,6 +252,7 @@ class ProgressHub(Hub):
Hub.refresh(self)
self._start_ransom_notes()
+ self._restart_spinner()
GLib.timeout_add(250, self._update_progress, self._install_done)
threadMgr.add(AnacondaThread(name=THREAD_INSTALL, target=doInstall,
args=(self.storage, self.payload, self.data, self.instclass)))
--
2.1.0
9 years, 6 months
[blivet][all] two simple bug fixes
by David Lehman
Patch 1 will prevent installation to any dmraid device.
Patch 2 will cause a traceback when trying to clear a disk that contains
a btrfs file system and no disklabel.
David Lehman (2):
Use super to get much-needed MRO magic in constructor. (#1158968)
Device status can never be True for non-existent devices. (#1156058)
blivet/devices/btrfs.py | 2 +-
blivet/devices/dm.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
1.9.3
9 years, 6 months
[f21/master] Load a stylesheet from product.img
by David Shea
Move an updated anaconda-gtk.css to /run/install/updates for
consistency. Change some of the stylesheet priorities so that they all
play nicely with one another. Missing icon overrides are loaded at a
higher priority than the default anaconda-gtk.css, and stylesheets from
updates.img and product.img are loaded at the same, even higher
priority.
---
pyanaconda/ui/gui/__init__.py | 29 ++++++++++++++++++++++++++---
scripts/makeupdates | 2 +-
2 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 96a5238..ed747e1 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -44,6 +44,16 @@ SCREENSHOT_DELAY = 1 # in seconds
ANACONDA_WINDOW_GROUP = Gtk.WindowGroup()
+# Stylesheet priorities to use for product-specific stylesheets and our
+# missing icon overrides. The missing icon rules should be higher than
+# the regular stylesheet, applied at GTK_STYLE_PROVIDER_PRIORITY_APPLICATION,
+# and stylesheets from updates.img and product.img should be higher than that,
+# so that they can override background images and not get re-overriden by us.
+# Both should be lower than GTK_STYLE_PROVIDER_PRIORITY_USER.
+STYLE_PROVIDER_PRIORITY_MISSING_ICON = Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION + 10
+STYLE_PROVIDER_PRIORITY_UPDATES = Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION + 20
+assert STYLE_PROVIDER_PRIORITY_UPDATES < Gtk.STYLE_PROVIDER_PRIORITY_USER
+
class GUIObject(common.UIObject):
"""This is the base class from which all other GUI classes are derived. It
thus contains only attributes and methods that are common to everything
@@ -505,7 +515,7 @@ class GraphicalUserInterface(UserInterface):
provider = Gtk.CssProvider()
provider.load_from_data(".logo { background-image: url('%s'); }" % replacement_image_path)
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider,
- Gtk.STYLE_PROVIDER_PRIORITY_USER)
+ STYLE_PROVIDER_PRIORITY_MISSING_ICON)
else:
log.warning("logo image is missing")
@@ -516,13 +526,13 @@ class GraphicalUserInterface(UserInterface):
provider = Gtk.CssProvider()
provider.load_from_data("AnacondaSpokeWindow #nav-box { background-image: none; }")
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider,
- Gtk.STYLE_PROVIDER_PRIORITY_USER)
+ STYLE_PROVIDER_PRIORITY_MISSING_ICON)
if not os.path.exists(sidebar_path):
provider = Gtk.CssProvider()
provider.load_from_data(".logo-sidebar { background-image: none; }")
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider,
- Gtk.STYLE_PROVIDER_PRIORITY_USER)
+ STYLE_PROVIDER_PRIORITY_MISSING_ICON)
def _widgetScale(self):
@@ -678,6 +688,19 @@ class GraphicalUserInterface(UserInterface):
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
+ # Look for updates to the stylesheet and apply them at a higher priority
+ if os.path.exists("/run/install/updates/anaconda-gtk.css"):
+ provider = Gtk.CssProvider()
+ provider.load_from_path("/run/install/updates/anaconda-gtk.css")
+ Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider,
+ STYLE_PROVIDER_PRIORITY_UPDATES)
+
+ if os.path.exists("/run/install/product/anaconda-gtk.css"):
+ provider = Gtk.CssProvider()
+ provider.load_from_path("/run/install/product/anaconda-gtk.css")
+ Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider,
+ STYLE_PROVIDER_PRIORITY_UPDATES)
+
# try to make sure a logo image is present
self._assureLogoImage()
diff --git a/scripts/makeupdates b/scripts/makeupdates
index ece273a..de3c5dd 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -295,7 +295,7 @@ def copyUpdatedFiles(tag, updates, cwd):
elif gitfile == "data/tmux.conf":
install_to_dir(gitfile, "usr/share/anaconda")
elif gitfile == "data/anaconda-gtk.css":
- install_to_dir(gitfile, "usr/share/anaconda")
+ install_to_dir(gitfile, "run/install/updates")
elif gitfile == "data/interactive-defaults.ks":
install_to_dir(gitfile, "usr/share/anaconda")
elif gitfile == "data/anaconda_options.txt":
--
2.1.0
9 years, 6 months
[anaconda:rhel6] Make EFI.bootDevice() return best device for several calling contexts (#1145812)
by Anne Mulhern
Resolves: rhbz#1145812
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
platform.py | 38 ++++++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)
diff --git a/platform.py b/platform.py
index 51e2e3f..59a782c 100644
--- a/platform.py
+++ b/platform.py
@@ -248,14 +248,40 @@ class EFI(Platform):
Return the boot device. The bootloader.drivelist is used to
set the precedence in cases where multiple partitions are
available from multiple devices.
+
+ Return the first ESP with a mountpoint, if there is one.
+ Otherwise, return the first ESP.
+
+ bootDevice() is called in a number of contexts, and the strategy
+ above is supposed to be the best for all.
+
+ A boot device with a mountpoint set is always preferred, as it
+ is assumed that that mountpoint will be valid to boot from,
+ and that it was set deliberately by some sort of user intervention.
+
+ Only a subset of the contexts in which bootDevice() can be called
+ require that the device's mountpoint be set for it to be useful.
+ During sanity checking, which occurs shortly before execution of
+ scheduled actions on storage, there are some conditions under which
+ the mountpoint must be set to prevent failure when storage
+ actions are executed.
"""
drive = self.anaconda.id.bootloader.drivelist[0]
- for part in self.anaconda.id.storage.partitions:
- if part.disk and part.disk.name == drive \
- and part.format.type == "efi" \
- and self.validBootPartSize(part.size):
- return part
- return None
+
+ def _isESP(part):
+ return part.disk and \
+ part.disk.name == drive and \
+ part.format.type == "efi" and \
+ self.validBootPartSize(part.size)
+ esps = (p for p in self.anaconda.id.storage.partitions if _isESP(p))
+
+ bootDevice = None
+ for part in esps:
+ if part.format.mountpoint:
+ bootDevice = part
+ break
+ bootDevice = bootDevice or part
+ return bootDevice
def bootloaderChoices(self, bl):
bootDev = self.bootDevice()
--
1.9.3
9 years, 6 months
[master/f21] Fix Size arithmatic operations (#1158792)
by Brian C. Lane
When Size is not on the left it needs to call the correct Decimal method
and make sure it returns a Size object. This also adds a test to make
sure the results of add, subtract, multiply, divide, modulo and power
are all Size objects.
There is some debate about what a Decimal / Size should return. I think
Size makes sense because it will act like Decimal for everything except
display purposes.
---
blivet/size.py | 19 +++++++++++++++----
tests/size_test.py | 28 ++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/blivet/size.py b/blivet/size.py
index 05a38b4..8220e21 100644
--- a/blivet/size.py
+++ b/blivet/size.py
@@ -235,25 +235,36 @@ class Size(Decimal):
def __add__(self, other, context=None):
return Size(Decimal.__add__(self, other, context=context))
-
- # needed to make sum() work with Size arguments
- def __radd__(self, other, context=None):
- return Size(Decimal.__radd__(self, other, context=context))
+ __radd__ = __add__
def __sub__(self, other, context=None):
# subtraction is implemented using __add__ and negation, so we'll
# be getting passed a Size
return Decimal.__sub__(self, other, context=context)
+ def __rsub__(self, other, context=None):
+ return Size(Decimal.__rsub__(self, other, context=context))
+
def __mul__(self, other, context=None):
return Size(Decimal.__mul__(self, other, context=context))
+ __rmul__ = __mul__
def __div__(self, other, context=None):
return Size(Decimal.__div__(self, other, context=context))
+ __rdiv__ = __div__
def __mod__(self, other, context=None):
return Size(Decimal.__mod__(self, other, context=context))
+ def __rmod__(self, other, context=None):
+ return Size(Decimal.__rmod__(self, other, context=context))
+
+ def __pow__(self, other, context=None):
+ return Size(Decimal.__pow__(self, other, context=context))
+
+ def __rpow__(self, other, context=None):
+ return Size(Decimal.__rpow__(self, other, context=context))
+
def convertTo(self, spec="b"):
""" Return the size in the units indicated by the specifier. The
specifier can be prefixes from the _decimalPrefixes and
diff --git a/tests/size_test.py b/tests/size_test.py
index 9841b94..c6ed011 100644
--- a/tests/size_test.py
+++ b/tests/size_test.py
@@ -163,5 +163,33 @@ class SizeTestCase(unittest.TestCase):
os.environ['LANG'] = saved_lang
locale.setlocale(locale.LC_ALL, '')
+ def testArithmetic(self):
+ s = Size("2GiB")
+
+ # Make sure arithmatic operations with Size always result in Size
+ self.assertIsInstance(s+s, Size)
+ self.assertIsInstance(s-s, Size)
+ self.assertIsInstance(s*s, Size)
+ self.assertIsInstance(s/s, Size)
+ self.assertIsInstance(s**Size(2), Size)
+ self.assertIsInstance(s % Size(7), Size)
+
+
+ # Make sure operations with non-Size on the right result in Size
+ self.assertIsInstance(s+2, Size)
+ self.assertIsInstance(s-2, Size)
+ self.assertIsInstance(s*2, Size)
+ self.assertIsInstance(s/2, Size)
+ self.assertIsInstance(s**2, Size)
+ self.assertIsInstance(s % 127, Size)
+
+ # Make sure operations with non-Size on the left result in Size
+ self.assertIsInstance(2+s, Size)
+ self.assertIsInstance(2-s, Size)
+ self.assertIsInstance(2*s, Size)
+ self.assertIsInstance(2/s, Size)
+ self.assertIsInstance(2**Size(2), Size)
+ self.assertIsInstance(1024 % Size(127), Size)
+
if __name__ == "__main__":
unittest.main()
--
1.9.3
9 years, 6 months
[blivet:master 0/5] Miscellaneous patches related to use of Size() (v3)
by Anne Mulhern
Remove _minSize assignment... is new.
Update minSize method headers is changed.
The rest are all the same as previous (except that they don't change lines
that were removed in a previous patch).
mulhern (5):
Make _minInstanceSize, a source of minSize() value, always a Size.
Remove _minSize assignment to 0 where it's inherited from superclass.
Update minSize method headers.
Put size values in Size universe eagerly.
Add a method that determines whether a number is an exact power of 2.
blivet/__init__.py | 2 +-
blivet/deviceaction.py | 3 ++-
blivet/devicefactory.py | 12 ++++++------
blivet/devicelibs/lvm.py | 9 ++++-----
blivet/devicelibs/mdraid.py | 3 ++-
blivet/devicelibs/raid.py | 13 +++++++------
blivet/devices/btrfs.py | 6 +++---
blivet/devices/disk.py | 3 ++-
blivet/devices/lvm.py | 14 +++++---------
blivet/devices/md.py | 4 ++--
blivet/devices/nodev.py | 3 ++-
blivet/devices/partition.py | 13 ++++++-------
blivet/devices/storage.py | 4 ++--
blivet/formats/__init__.py | 8 +++++++-
blivet/formats/disklabel.py | 7 +++----
blivet/formats/fs.py | 23 +++++++----------------
blivet/partitioning.py | 13 ++++++-------
blivet/util.py | 28 ++++++++++++++++++++++++++++
tests/devicelibs_test/raid_test.py | 24 ++++++++++++------------
tests/partitioning_test.py | 6 +++---
tests/size_test.py | 4 ++--
tests/util_test.py | 22 ++++++++++++++++++++++
22 files changed, 134 insertions(+), 90 deletions(-)
create mode 100644 tests/util_test.py
--
1.9.3
9 years, 6 months
[PATCH 1/2] Add installimg command for use in the templates
by Brian C. Lane
installimg SRCDIR DESTFILE
Create a compressed cpio archive of the contents of SRCDIR and place
it in DESTFILE.
If SRCDIR doesn't exist or is empty nothing is created.
Examples:
installimg ${LORAXDIR}/product/ images/product.img
---
src/pylorax/ltmpl.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/pylorax/ltmpl.py b/src/pylorax/ltmpl.py
index 030b9ca..88d02dd 100644
--- a/src/pylorax/ltmpl.py
+++ b/src/pylorax/ltmpl.py
@@ -31,6 +31,7 @@ from pylorax.sysutils import joinpaths, cpfile, mvfile, replace, remove
from pylorax.yumhelper import LoraxDownloadCallback, LoraxTransactionCallback, LoraxRpmCallback
from pylorax.base import DataHolder
from pylorax.executils import runcmd, runcmd_output
+from pylorax.imgutils import mkcpio
from mako.lookup import TemplateLookup
from mako.exceptions import text_error_template
@@ -233,6 +234,23 @@ class LoraxTemplateRunner(object):
for src in rglob(self._in(srcglob), fatal=True):
cpfile(src, self._out(dest))
+ def installimg(self, srcdir, destfile):
+ '''
+ installimg SRCDIR DESTFILE
+ Create a compressed cpio archive of the contents of SRCDIR and place
+ it in DESTFILE.
+
+ If SRCDIR doesn't exist or is empty nothing is created.
+
+ Examples:
+ installimg ${LORAXDIR}/product/ images/product.img
+ installimg ${LORAXDIR}/updates/ images/updates.img
+ '''
+ if not os.path.isdir(self._in(srcdir)) or os.listdir(self._in(srcdir)) == 0:
+ return
+ logger.info("Creating image file %s from contents of %s", self._out(destfile), self._in(srcdir))
+ mkcpio(self._in(srcdir), self._out(destfile))
+
def mkdir(self, *dirs):
'''
mkdir DIR [DIR ...]
--
1.9.3
9 years, 6 months
[PATCH] Update the background image paths used in Fedora.
by David Shea
With stylesheet help from Máirín Duffy.
Copy the RHEL sidebar and topbar background stylesheet blocks into
Fedora. Change the Fedora background color. Stop gtk from making
buttons on the new background color look bad.
Update assureLogoImage to remove missing sidebar and topbar background
images from the stylesheet.
---
data/anaconda-gtk.css | 29 +++++++++--------------------
pyanaconda/ui/gui/__init__.py | 19 ++++++++++++++++++-
2 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/data/anaconda-gtk.css b/data/anaconda-gtk.css
index 79220e9..230c961 100644
--- a/data/anaconda-gtk.css
+++ b/data/anaconda-gtk.css
@@ -113,15 +113,15 @@
/* vendor-specific colors/images */
@define-color redhat #41413e;
-@define-color fedora #006eb4;
+@define-color fedora #2f4265;
-/* swap these into logo & sidebar classes for RHEL */
-/*
.logo-sidebar {
background-image: url('/usr/share/anaconda/pixmaps/sidebar-bg.png');
- background-color: @redhat;
+ background-color: @fedora;
+ background-repeat: no-repeat;
}
+/* logo and sidebar classes for Fedora */
.logo {
background-image: url('/usr/share/anaconda/pixmaps/sidebar-logo.png');
background-position: 50% 20px;
@@ -130,27 +130,16 @@
}
AnacondaSpokeWindow #nav-box {
- background-color: @redhat;
+ background-color: @fedora;
background-image: url('/usr/share/anaconda/pixmaps/topbar-bg.png');
background-repeat: repeat;
color: white;
}
-AnacondaSpokeWindow #layout-indicator {
- color: black;
-}
-*/
-
-/* logo and sidebar classes for Fedora */
-.logo {
- background-image: url('/usr/share/anaconda/pixmaps/logo.png');
- background-position: 50% 20px;
- background-repeat: no-repeat;
- background-color: transparent;
-}
-
-.logo-sidebar {
- background-color: @fedora;
+/* Remove the box-shadow from buttons in the nav-box because it adds a white stripe
+ * below the buttons and makes them look dumb */
+AnacondaSpokeWindow #nav-box GtkButton {
+ box-shadow: none;
}
AnacondaSpokeWindow #nav-box {
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 32023c1..285f9f5 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -487,7 +487,7 @@ class GraphicalUserInterface(UserInterface):
# make sure there is a logo image present,
# otherwise the console will get spammed by errors
replacement_image_path = None
- logo_path = "/usr/share/anaconda/pixmaps/logo.png"
+ logo_path = "/usr/share/anaconda/pixmaps/sidebar-logo.png"
header_path = "/usr/share/anaconda/pixmaps/anaconda_header.png"
sad_smiley_path = "/usr/share/icons/Adwaita/48x48/emotes/face-crying.png"
if not os.path.exists(logo_path):
@@ -509,6 +509,23 @@ class GraphicalUserInterface(UserInterface):
else:
log.warning("logo image is missing")
+ # Look for the top and sidebar images. If missing remove the background-image
+ replacement_color = "#006eb4"
+ topbar_path = "/usr/share/anaconda/pixmaps/topbar-bg.png"
+ sidebar_path = "/usr/share/anaconda/pixmaps/sidebar-bg.png"
+ if not os.path.exists(topbar_path):
+ provider = Gtk.CssProvider()
+ provider.load_from_data("AnacondaSpokeWindow #nav-box { background-image: none; }")
+ Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider,
+ Gtk.STYLE_PROVIDER_PRIORITY_USER)
+
+ if not os.path.exists(sidebar_path):
+ provider = Gtk.CssProvider()
+ provider.load_from_data(".logo-sidebar { background-image: none; }")
+ Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider,
+ Gtk.STYLE_PROVIDER_PRIORITY_USER)
+
+
def _widgetScale(self):
# First, check if the GDK_SCALE environment variable is already set. If so,
# leave it alone.
--
2.1.0
9 years, 6 months
[rhel7-branch/master/f21-branch] Deal with permanent lack of random data entropy on some machines
by Vratislav Podzimek
On some machines (s390x would never be your guess, would it?) there is a permanent
lack of random data entropy which is quite a sever issue, but nobody seems to be
alerted by the fact. So (as expected) it turns out that we cannot just wait
forever for enough random data entropy to be gathered by kernel. Thus these two
patches implement a timeout that forces the installation to continue even if
there's not enough entropy for LUKS format creation. A warning is logged in such
case.
The new look of the EntropyDialog can be seen in the following screenshot:
http://vpodzime.fedorapeople.org/entropy_wait_dialog_timeout.png
Is the time information more or less unrelated to the entropy % too confusing?
Ideas? Suggestions? All are welcome, just please note that we should avoid
adding options/switches tweaking the behaviour because we don't want to commit
to supporting such options/switches in the future and it's hard to predict how
the situation around requiring/enforcing enough entropy will evolve. Obviously
the ideal solution is to patch kernel to gather enough entropy even on s390x,
make virt-rng the default etc. so we should stand on "the right side" and help
pushing such solutions further.
Vratislav Podzimek (1):
Add timeout to callbacks waiting for enough entropy (#1073679)
pyanaconda/constants.py | 3 +++
pyanaconda/ui/gui/spokes/lib/entropy_dialog.glade | 25 +++++++++++++++---
pyanaconda/ui/gui/spokes/lib/entropy_dialog.py | 25 +++++++++++++++---
pyanaconda/ui/lib/entropy.py | 32 +++++++++++++++++------
4 files changed, 71 insertions(+), 14 deletions(-)
--
1.9.3
9 years, 6 months