[PATCH] Log the actual exception for getPackage
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
pyanaconda/packaging/yumpayload.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 0119470..672b1df 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -1609,11 +1609,12 @@ class RPMCallback(object):
exn = PayloadInstallError("failed to get package")
if errorHandler.cb(exn, package=txmbr.po) == ERROR_RAISE:
raise exn
- except (yum.Errors.NoMoreMirrorsRepoError, IOError):
+ except (yum.Errors.NoMoreMirrorsRepoError, IOError) as e:
if os.path.exists(txmbr.po.localPkg()):
os.unlink(txmbr.po.localPkg())
log.debug("retrying download of %s" % txmbr.po)
continue
+ log.error("getPackage error: %s" % (e,))
exn = PayloadInstallError("failed to open package")
if errorHandler.cb(exn, package=txmbr.po) == ERROR_RAISE:
raise exn
--
1.8.1.4
11 years, 1 month
[master 00/10] Addon Repo and .treeinfo support for Source Spoke
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
This set of patches adds an new section to the source spoke which will show
addon repos from kickstart files and additional .treeinfo repos. The user can
enable/disable/delete them or add their own. The normal metadata refetch will
be triggered when something is changed in one of the repos.
This also enabled updates by default and hooks up the checkbox to disable the
updates.
I added a new attribute to the kickstart RepoData object to track whether or
not it has been enabled. This helps with the UI interface as well as .treeinfo
repos which are disabled by default.
I also added a bit of a hack to the repoStore use of RepoData, an attribute to
keep track of the original name of the object so that if the user edits the
name the change can be propagated to the original object instead of making a
new one. This attr is not part of kickstart since it is only used by the UI's
copy of the repo information.
Brian C. Lane (10):
Change the source DiskOverview to a label
Modify repo interface in packaging
Add enable flag to RepoData object
Adjust _getTreeInfo so that proxy_url can be passed
Enable updates repo by default
Addon repo glade changes
Remove the previous addon repo code and UI
Add repo addon to source spoke
Disable failed repos, not remove them
Add the addon repos from a repo's treeinfo file
pyanaconda/iutil.py | 22 +
pyanaconda/kickstart.py | 12 +
pyanaconda/packaging/__init__.py | 62 ++-
pyanaconda/packaging/yumpayload.py | 96 +++-
pyanaconda/ui/gui/spokes/software.py | 3 -
pyanaconda/ui/gui/spokes/source.glade | 789 +++++++++++++++++---------------
pyanaconda/ui/gui/spokes/source.py | 523 ++++++++++++---------
tests/pyanaconda_test/packaging_test.py | 4 +-
8 files changed, 880 insertions(+), 631 deletions(-)
--
1.8.1.2
11 years, 1 month
[PATCH] Replace the custom part size spinner with an entry.
by Chris Lumens
We don't like GtkSpinButton, and this makes the widget the same as the one
on the Add Mount Point dialog. That means it accepts Sizes as well. Leaving
the size blank should result in the mount point expanding to take up all
available free space.
---
anaconda.spec.in | 2 +-
pyanaconda/ui/gui/spokes/custom.glade | 16 ++-----
pyanaconda/ui/gui/spokes/custom.py | 84 +++++++++++++++++++----------------
3 files changed, 50 insertions(+), 52 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 85585f0..4458537 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -69,7 +69,7 @@ BuildRequires: s390utils-devel
%endif
Requires: anaconda-widgets = %{version}-%{release}
-Requires: python-blivet >= 0.6
+Requires: python-blivet >= 0.8
Requires: gnome-icon-theme-symbolic
Requires: python-meh >= %{mehver}
Requires: libreport-anaconda >= 2.0.21-1
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade
index 6319a50..d5d3d82 100644
--- a/pyanaconda/ui/gui/spokes/custom.glade
+++ b/pyanaconda/ui/gui/spokes/custom.glade
@@ -618,10 +618,10 @@ use. Try something else?</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes"><b>_Desired Capacity (MB):</b></property>
+ <property name="label" translatable="yes"><b>_Desired Capacity:</b></property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">sizeSpinner</property>
+ <property name="mnemonic_widget">sizeEntry</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -645,15 +645,10 @@ use. Try something else?</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="sizeSpinner">
+ <object class="GtkEntry" id="sizeEntry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
- <property name="invisible_char">●</property>
- <property name="width_chars">7</property>
- <property name="invisible_char_set">True</property>
- <property name="adjustment">sizeAdjustment</property>
- <property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">3</property>
@@ -1995,11 +1990,6 @@ use. Try something else?</property>
<column type="gchararray"/>
</columns>
</object>
- <object class="GtkAdjustment" id="sizeAdjustment">
- <property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
<object class="GtkListStore" id="raidLevelStore">
<columns>
<!-- column-name raidLevel -->
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index ba93b72..deec8ef 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -128,6 +128,24 @@ device_text_map = {DEVICE_TYPE_LVM: DEVICE_TEXT_LVM,
partition_only_format_types = ["efi", "hfs+", "prepboot", "biosboot",
"appleboot"]
+def size_from_entry(entry):
+ size_text = entry.get_text().strip()
+
+ # if no unit was specified, default to MB
+ if not re.search(r'[A-Za-z]+$', size_text):
+ size_text += "MB"
+
+ try:
+ size = Size(spec=size_text)
+ except Exception:
+ return None
+ else:
+ # Minimium size for ui-created partitions is 1MB.
+ if size.convertTo(spec="mb") < 1:
+ size = Size(spec="1mb")
+
+ return size
+
# XXX: Hack, hack, hack. For some reason displaying lightboxed dialogs on the
# custom storage spoke means that redisplaying those dialogs later never works
# and the UI looks frozen. So I'm just going to override the real enlightbox
@@ -217,21 +235,7 @@ class AddDialog(GUIObject):
if self._error:
return
- size_text = self.builder.get_object("sizeEntry").get_text().strip()
-
- # if no unit was specified, default to MB
- if not re.search(r'[A-Za-z]+$', size_text):
- size_text += "MB"
-
- try:
- self.size = Size(spec=size_text)
- except Exception:
- pass
- else:
- # Minimum size for ui-created partitions is 1MB.
- if self.size.convertTo(spec="mb") < 1:
- self.size = Size(spec="1mb")
-
+ self.size = size_from_entry(self.builder.get_object("sizeEntry"))
self.window.destroy()
def refresh(self):
@@ -415,7 +419,7 @@ class HelpDialog(GUIObject):
self.window.destroy()
class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
- builderObjects = ["customStorageWindow", "sizeAdjustment",
+ builderObjects = ["customStorageWindow",
"partitionStore", "raidStoreFiltered", "raidLevelStore",
"addImage", "removeImage", "settingsImage",
"mountPointCompletion", "mountPointStore"]
@@ -881,7 +885,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
log.debug("old_name: %s" % old_name)
log.debug("new_name: %s" % name)
- size = self.builder.get_object("sizeSpinner").get_value()
+ size = size_from_entry(self.builder.get_object("sizeEntry"))
+ if size:
+ size = int(size.convertTo(spec="MB"))
log.debug("new size: %s" % size)
log.debug("old size: %s" % device.size)
@@ -1102,7 +1108,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
## SIZE
##
# new size means resize for existing devices and adjust for new ones
- changed_size = (int(size) != int(device.size))
+ changed_size = (size != int(device.size))
if changed_size or changed_disk_set or \
(changed_encryption and factory.encrypt_members and
not device.exists):
@@ -1111,6 +1117,15 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
if changed_size and device.exists and device.resizable:
with ui_storage_logger():
try:
+ # If no size was specified, we just want to grow to
+ # the maximum. But resizeDevice doesn't take None for
+ # a value.
+ if not size:
+ if hasattr(device, "vg"):
+ size = device.size + device.vg.freeSpace
+ else:
+ size = device.maxSize
+
self.__storage.resizeDevice(device, size)
except StorageError as e:
log.error("failed to schedule device resize: %s" % e)
@@ -1307,6 +1322,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
device_type = self._get_current_device_type()
log.debug("populate_raid: %s, %s" % (device_type, raid_level))
+ # If size comes in as a Size, convert it to a number. A None is
+ # fine, though.
+ if size and isinstance(size, Size):
+ size = int(size.convertTo(spec="MB"))
+
raid_label = self.builder.get_object("raidLevelLabel")
raid_combo = self.builder.get_object("raidLevelCombo")
@@ -1389,7 +1409,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
nameEntry = self.builder.get_object("nameEntry")
selectedDeviceLabel = self.builder.get_object("selectedDeviceLabel")
selectedDeviceDescLabel = self.builder.get_object("selectedDeviceDescLabel")
- sizeSpinner = self.builder.get_object("sizeSpinner")
+ sizeEntry = self.builder.get_object("sizeEntry")
typeCombo = self.builder.get_object("deviceTypeCombo")
fsCombo = self.builder.get_object("fileSystemTypeCombo")
expander = self.builder.get_object("customizeExpander")
@@ -1439,23 +1459,13 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
else:
labelEntry.set_tooltip_text(_("This file system does not support labels."))
- if device.exists:
- min_size = device.minSize
- max_size = device.maxSize
- else:
- min_size = max(device.format.minSize, 1.0)
- max_size = device.size + float(self._free_space.convertTo(spec="mb")) # FIXME
-
- log.debug("min: %s max: %s current: %s" % (min_size, max_size, device.size))
- sizeSpinner.set_range(min_size,
- max_size)
- sizeSpinner.set_value(device.size)
- sizeSpinner.set_sensitive(device.resizable or not device.exists)
+ sizeEntry.set_text(str(Size(spec="%d MB" % device.size)))
+ sizeEntry.set_sensitive(device.resizable or not device.exists)
- if sizeSpinner.get_sensitive():
- sizeSpinner.props.has_tooltip = False
+ if sizeEntry.get_sensitive():
+ sizeEntry.props.has_tooltip = False
else:
- sizeSpinner.set_tooltip_text(_("This file system may not be resized."))
+ sizeEntry.set_tooltip_text(_("This file system may not be resized."))
self._reformatCheckbox.set_active(not device.format.exists)
self._reformatCheckbox.set_sensitive(not device.protected and
@@ -1942,8 +1952,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
return
self._device_disks = disks
- self._populate_raid(self._get_raid_level(),
- self.builder.get_object("sizeSpinner").get_value())
+ self._populate_raid(self._get_raid_level(), size_from_entry(self.builder.get_object("sizeEntry")))
def run_vg_editor(self, vg=None, name=None):
if vg:
@@ -2317,8 +2326,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
exists = self._current_selector and self._current_selector._device.exists
self._configButton.set_sensitive(not exists and new_type != DEVICE_TYPE_LVM)
- size = self.builder.get_object("sizeSpinner").get_value()
- self._populate_raid(raid_level, size)
+ self._populate_raid(raid_level, size_from_entry(self.builder.get_object("sizeEntry")))
self._populate_lvm()
nameEntry = self.builder.get_object("nameEntry")
--
1.8.1.2
11 years, 1 month
[master] Two patches helping with threading a bit
by Vratislav Podzimek
PATCH 1/2 adds a method to the ThreadManager which can be used to determine if
being in the main thread or not. A reference to the current thread is stored
when ThreadManager is being instantiated which means it has to happen in the
main thread. That's why I moved the instantiation to the initThreading function
which is safer than relying on pyanaconda.threads being imported from the
threadMgr for the first time. However if some other module imports
pyanaconda.threads.threadMgr before the initThreads function is called it will
get None. I understand this is far from being ideal, suggestions welcomed.
The new method can be, of course, used also in pyanaconda/exception.py instead
of passing main_thread_id to the handler.
PATCH 2/2 uses the new ability of threadMgr to make our gtk_* decorators safer.
Vratislav Podzimek (2):
Add method for checking if in main thread to the ThreadManager
Make our gtk_* decorators safer and more intelligent
anaconda | 10 ++++---
pyanaconda/threads.py | 22 +++++++++++---
pyanaconda/ui/gui/__init__.py | 8 +++---
pyanaconda/ui/gui/hubs/progress.py | 4 +--
pyanaconda/ui/gui/spokes/datetime_spoke.py | 6 ++--
pyanaconda/ui/gui/spokes/software.py | 4 +--
pyanaconda/ui/gui/spokes/source.py | 4 +--
pyanaconda/ui/gui/spokes/storage.py | 4 +--
pyanaconda/ui/gui/utils.py | 46 +++++++++++++++++++-----------
9 files changed, 68 insertions(+), 40 deletions(-)
--
1.7.11.7
11 years, 1 month
[PATCH lorax/master] Print & log messages on scriptlet/transaction errors
by Will Woods
We should probably let the user know if something goes wrong with the
transaction or if a scriptlet fails. So: log the messages so we can find
(and, one hopes, fix) them later.
---
src/pylorax/yumhelper.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/pylorax/yumhelper.py b/src/pylorax/yumhelper.py
index ea0ef07..13a2bda 100644
--- a/src/pylorax/yumhelper.py
+++ b/src/pylorax/yumhelper.py
@@ -115,3 +115,10 @@ class LoraxRpmCallback(yum.rpmtrans.RPMBaseCallback):
def filelog(self, package, action):
if self.fileaction.get(action) == "Installed":
logger.debug("{0} installed successfully".format(package))
+
+ def errorlog(self, msg):
+ logger.warning("RPM transaction error: %s", msg)
+
+ def scriptout(self, package, msgs):
+ if msgs:
+ logger.info("%s scriptlet output:\n%s", package, msgs)
--
1.8.1.4
11 years, 1 month
[PATCH] Display the reason for payloadInstallHandler error
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
pyanaconda/errors.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py
index 5011683..815a930 100644
--- a/pyanaconda/errors.py
+++ b/pyanaconda/errors.py
@@ -216,7 +216,7 @@ class ErrorHandler(object):
else:
message = _("The following error occurred while installing. This is "
"a fatal error and installation will be aborted.")
- message += "\n\n" + str(kwargs["exception"])
+ message += "\n\n" + str(kwargs["exception"])
self.ui.showError(message)
return ERROR_RAISE
--
1.8.1.4
11 years, 1 month
[PATCH lorax/master] sysutils: add -x to cp in linktree
by Will Woods
Since you can't make cross-device links, you'd think that cp -l (make
links) would imply -x (don't cross devices).
You'd be wrong.
---
src/pylorax/sysutils.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/pylorax/sysutils.py b/src/pylorax/sysutils.py
index 6ce4c93..8743b9a 100644
--- a/src/pylorax/sysutils.py
+++ b/src/pylorax/sysutils.py
@@ -106,5 +106,4 @@ def remove(target):
os.unlink(target)
def linktree(src, dst):
- runcmd(["/bin/cp", "-al", src, dst])
-
+ runcmd(["/bin/cp", "-alx", src, dst])
--
1.8.1.4
11 years, 1 month
Move journal to disk once we have disks
by Will Woods
Here is an untested patch to move the journal to the target disk as soon as
it's available! I'm presenting it for discussion early, because there were a
couple things I wondered about:
1) Is Payload.preInstall() the right place for this?
As far as I can tell this is the earliest place where we're sure we have the
target disk mounted. But I feel odd about putting something that really isn't
packaging-related into packaging/*.py.
Is this reasonable, or should we be creating other plugin-type hooks for this
sort of thing?
2) Why is 99-copy-logs.ks so weird?
It could easily be 3 lines long:
LOGDIR=$ANA_INSTALL_PATH/var/log/anaconda
cp /tmp/{syslog,*.log} $LOGDIR
chmod 0600 $LOGDIR/{syslog,*.log}
except for some reason we change the filenames.. for *some* logs. Like:
/tmp/X.log -> /var/log/anaconda/anaconda.xlog
/tmp/program.log -> /var/log/anaconda/anaconda.program.log
I suspect the double 'anaconda/anaconda.' junk comes from when we didn't used
to copy the logs to their own directory. So should we clean this up? Or does
something REALLY REALLY IMPORTANT need those exact log names?
-w
11 years, 1 month
[PATCH lorax/master] treebuilder: fix "Can't stat exclude path "/selinux"..." message
by Will Woods
/selinux has been gone for *years*. Drop the exclude.
---
src/pylorax/treebuilder.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py
index 4520414..4275550 100644
--- a/src/pylorax/treebuilder.py
+++ b/src/pylorax/treebuilder.py
@@ -158,7 +158,7 @@ class RuntimeBuilder(object):
# Reset selinux context on new rootfs
with imgutils.LoopDev( joinpaths(workdir, "LiveOS/rootfs.img") ) as loopdev:
with imgutils.Mount(loopdev) as mnt:
- cmd = [ "setfiles", "-e", "/proc", "-e", "/sys", "-e", "/dev", "-e", "/selinux", "/etc/selinux/targeted/contexts/files/file_contexts", "/"]
+ cmd = [ "setfiles", "-e", "/proc", "-e", "/sys", "-e", "/dev", "/etc/selinux/targeted/contexts/files/file_contexts", "/"]
runcmd(cmd, root=mnt)
# squash the live rootfs and clean up workdir
--
1.8.1.4
11 years, 1 month
[PATCH lorax/master 1/2] runtime-install: install shim-unsigned
by Will Woods
Otherwise you get errors about missing MokManager.efi if shim doesn't
exist in the repos (e.g. before the Alpha build)
---
share/runtime-install.tmpl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/share/runtime-install.tmpl b/share/runtime-install.tmpl
index 686fb0d..8c1fd34 100644
--- a/share/runtime-install.tmpl
+++ b/share/runtime-install.tmpl
@@ -29,7 +29,8 @@ installpkg kernel
installpkg kernel-PAE gpart
%endif
%if basearch in ("i386", "x86_64"):
- installpkg grub2 grub2-tools shim grub2-efi efibootmgr biosdevname memtest86+ syslinux
+ installpkg grub2 grub2-tools biosdevname memtest86+ syslinux
+ installpkg efibootmgr grub2-efi shim shim-unsigned
%endif
%if basearch in ("ppc", "ppc64"):
installpkg grub2 grub2-tools yaboot fbset hfsutils kernel-bootwrapper ppc64-utils
--
1.8.1.4
11 years, 1 month