Re: [rhinstaller/anaconda/pulls/654 rhel7-branch] Keep the subdir in
driver disk update paths (#1296306)
by dashea
> @@ -206,21 +206,41 @@ def ensure_dir(d):
> """make sure the given directory exists."""
> subprocess.check_call(["mkdir", "-p", d])
>
> -def move_files(files, destdir):
> +def move_files(files, destdir, basedir):
> """move files into destdir (iff they're not already under destdir)"""
> - ensure_dir(destdir)
> for f in files:
> if f.startswith(destdir):
> continue
> - subprocess.call(["mv", "-f", f, destdir])
> + dest = destdir+"/"+dest_strip(f, basedir)
> + ensure_dir(os.path.dirname(dest))
> + subprocess.call(["mv", "-f", f, dest])
>
> -def copy_files(files, destdir):
> +def dest_strip(dest, basedir):
> + """strip a base directory plus kernel version from a path"""
> + # Strip the basedir and any leftover leading /'s
> + dest = dest[len(basedir):]
> + while dest.startswith('/'):
> + dest = dest[1:]
> +
> + # Look for a leading directory that is a version number
> + if "/" in dest and fnmatch.fnmatch(dest, "*.ko*") and dest[0].isdigit():
> + # Drop the leading directory
> + dest = "/".join(dest.split('/')[1:])
> +
> + if dest.startswith("kernel/"):
> + dest = "/".join(dest.split('/')[1:])
> +
> + return dest
> +
> +def copy_files(files, destdir, basedir):
> """copy files into destdir (iff they're not already under destdir)"""
Ha! copy-n-paste typos.
--
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/654#discussion_r65453228
8 years
[rhel7-branch 1/1] Display storage errors that cause no disks to be
selected
(#1340240)
by dashea
From: "Brian C. Lane" <bcl(a)redhat.com>
Problems allocating space can result in no disks being selected, but
displaying 'No disks selected; ...' doesn't make it obvious what has
happened.
This checks for errors and warnings and displays them instead, hopefully
leading the user to the actual problem.
eg. this happens when a kickstart tries to allocate partitions that are
too big for the disk(s).
Related: rhbz#1340240
---
pyanaconda/ui/gui/spokes/storage.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index d29ec39..d2adf98 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -574,10 +574,16 @@ def refresh(self):
self._update_summary()
+ self._check_problems()
+
+ def _check_problems(self):
if self.errors:
self.set_warning(_("Error checking storage configuration. <a href=\"\">Click for details.</a>"))
+ return True
elif self.warnings:
self.set_warning(_("Warning checking storage configuration. <a href=\"\">Click for details.</a>"))
+ return True
+ return False
def initialize(self):
NormalSpoke.initialize(self)
@@ -695,7 +701,9 @@ def _update_summary(self):
if len(self.disks) == 0:
self.set_warning(_("No disks detected. Please shut down the computer, connect at least one disk, and restart to complete installation."))
elif not anySelected:
- self.set_warning(_("No disks selected; please select at least one disk to install to."))
+ # There may be an underlying reason that no disks were selected, give them priority.
+ if not self._check_problems():
+ self.set_warning(_("No disks selected; please select at least one disk to install to."))
else:
self.clear_info()
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/5f389caa9d94ffb5d1a139de69...
8 years