[PATCH 1/2] Fix pylint errors in the latest dnf-related commit.
by Chris Lumens
---
pyanaconda/anaconda.py | 1 +
pyanaconda/packaging/dnfpayload.py | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/anaconda.py b/pyanaconda/anaconda.py
index c23630c..a2662e7 100644
--- a/pyanaconda/anaconda.py
+++ b/pyanaconda/anaconda.py
@@ -123,6 +123,7 @@ class Anaconda(object):
try:
from pyanaconda.packaging.dnfpayload import DNFPayload
klass = DNFPayload
+ # pylint: disable-msg=W0703
except Exception:
log.critical('Importing DNF failed.', exc_info=True)
else:
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index ad8120e..abf7e12 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -28,6 +28,7 @@ from pyanaconda.progress import progressQ
import itertools
import logging
import multiprocessing
+import operator
import pyanaconda.constants as constants
import pyanaconda.errors as errors
import pyanaconda.iutil
@@ -91,7 +92,7 @@ def _pick_mpoint(df, requested):
requested = requested + Size(en_spec="150 MB")
sufficients = {key : val for (key,val) in df.items() if val > requested
and reasonable_mpoint(key)}
- log.info('Sufficient mountpoints found: %s' % sufficients)
+ log.info('Sufficient mountpoints found: %s', sufficients)
# prefer /tmp:
if '/tmp' in sufficients:
--
1.8.3.1
10 years, 3 months
[PATCH anaconda:rhel7/master] Seed the default devicetree value for ARMv8
by d.marlin
In order to add a devicetree entry in the grub.cfg file, a valid
default value is needed. This can be provided in the grub default
file (GRUB_DEFAULT_DTB in /etc/default/grub).
Set the default value to apm-mustang.dtb, since that is the only
hardware we currently have. This value can be changed later
(post install), but some valid value must be set in order to seed
the variable.
Signed-off-by: David A. Marlin <dmarlin(a)redhat.com>
---
pyanaconda/bootloader.py | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index bc0ce8f..d0b16e2 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1740,6 +1740,17 @@ class Aarch64EFIGRUB(EFIGRUB):
_serial_consoles = ["ttyAMA", "ttyS"]
+ #
+ # In addition to the normal grub configuration variables,
+ # add one more to set the default device-tree filename
+ #
+ def write_defaults(self):
+ super(EFIGRUB, self).write_defaults()
+
+ defaults_file = "%s%s" % (ROOT_PATH, self.defaults_file)
+ defaults = open(defaults_file, "a+")
+ defaults.write("GRUB_DEFAULT_DTB=\"apm-mustang.dtb\"\n")
+ defaults.close()
class MacEFIGRUB(EFIGRUB):
def mactel_config(self):
--
1.7.1
10 years, 3 months
[blivet:rhel7/master 0/6] Make filesystem labeling tests not run when necessary utilities are missing from the environment
by Anne Mulhern
The rundown is
* Change a few...this step is mechanical and all in formats/fs.py so should be
safe.
* Make DeviceFormat.supported...this is a little more dramatic because supported
appears higher in the class hierarchy and is used more often in the code.
Also, it's used in anaconda, so requires a mechanical anaconda patch as well.
Should be mechanical, however.
* Move SwapSpace tests...trivial.
* Refactor labeling tests...the step that means I'm removing more code than I'm
adding!
* Filesystem labeling tests...fixes the problem, efficiently.
Without the refactoring there would have been way too many new annotations.
* Rename misc_test.py...high time this happened.
*** BLURB HERE ***
mulhern (6):
Change a few instance methods to class methods (#1065422)
Make DeviceFormat.supported a class method (#1065422)
Move SwapSpace tests into a separate class (#1065422)
Refactor labeling tests (#1065422)
Filesystem labeling tests will not run without utilities (#1065422)
Rename misc_test.py to something more descriptive (#1065422)
blivet/__init__.py | 2 +-
blivet/formats/__init__.py | 12 +-
blivet/formats/biosboot.py | 4 +-
blivet/formats/fs.py | 112 +++++------
blivet/formats/prepboot.py | 4 +-
tests/formats_test/fslabeling.py | 169 +++++++++++++++++
tests/formats_test/labeling_test.py | 153 +++++++++++++++
tests/formats_test/misc_test.py | 364 ------------------------------------
8 files changed, 389 insertions(+), 431 deletions(-)
create mode 100644 tests/formats_test/fslabeling.py
create mode 100755 tests/formats_test/labeling_test.py
delete mode 100755 tests/formats_test/misc_test.py
--
1.8.3.1
10 years, 3 months
[master][PATCH] There is no firstboot on Fedora
by Vratislav Podzimek
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/kickstart.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 7a2206c..1b2f387 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -600,9 +600,8 @@ class Firstboot(commands.firstboot.FC3_Firstboot):
f = open(ROOT_PATH + "/etc/reconfigSys", "w+")
f.close()
- iutil.execWithRedirect("systemctl", [action, "firstboot-graphical.service",
- "initial-setup-graphical.service",
- "initial-setup-text.service"],
+ iutil.execWithRedirect("systemctl", [action, "initial-setup-graphical.service",
+ "initial-setup-text.service"],
root=ROOT_PATH)
class Group(commands.group.F12_Group):
--
1.8.5.3
10 years, 3 months
[master][PATCH] Reraise the exception properly
by Vratislav Podzimek
The raise statement takes 1 to 3 arguments, replacing the missing ones with
None. We have to pass it all three objects to get a proper exception with a
stack.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/threads.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/threads.py b/pyanaconda/threads.py
index 5b7a80b..b1b61f7 100644
--- a/pyanaconda/threads.py
+++ b/pyanaconda/threads.py
@@ -153,7 +153,7 @@ class ThreadManager(object):
exc_info = self._errors.pop(name)
if exc_info:
- raise exc_info
+ raise exc_info[0], exc_info[1], exc_info[2]
def in_main_thread(self):
"""Return True if it is run in the main thread."""
--
1.8.5.3
10 years, 3 months
[PATCH 1/3] DNFPayload: use dnf.exceptions.MarkingError.
by Ales Kozumplik
From: Ales Kozumplik <ales(a)redhat.com>
PackageNotFoundError is deprecated.
---
pyanaconda/packaging/dnfpayload.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index d634a8e..5bcb596 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -166,7 +166,7 @@ class DNFPayload(packaging.PackagePayload):
def _install_package(self, pkg_name):
try:
return self._base.install(pkg_name)
- except dnf.exceptions.PackageNotFoundError:
+ except dnf.exceptions.MarkingError:
raise packaging.NoSuchPackage(pkg_name)
def _miss(self, exn):
--
1.8.5.3
10 years, 3 months
[PATCH blivet] If /etc/os-release exists, check it to identify an installed system.
by Chris Lumens
This should allow us to identify and list installed OSes that do not have a
redhat-release file (which is most of them), but are new enough to have an
os-release file (which is probably not yet that many).
---
blivet/__init__.py | 70 ++++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 57 insertions(+), 13 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py
index 59b63ef..666959f 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -53,6 +53,7 @@ import sys
import statvfs
import copy
import tempfile
+import shlex
try:
import nss.nss
@@ -2962,6 +2963,57 @@ class FSSet(object):
self._fstab_swaps = set(devices)
+def releaseFromRedhatRelease(fn):
+ relName = None
+ relVer = None
+
+ with open(fn) as f:
+ try:
+ relstr = f.readline().strip()
+ except (IOError, AttributeError):
+ relstr = ""
+
+ # get the release name and version
+ # assumes that form is something
+ # like "Red Hat Linux release 6.2 (Zoot)"
+ (product, sep, version) = relstr.partition(" release ")
+ if sep:
+ relName = product
+ relVer = version.split()[0]
+
+ return (relName, relVer)
+
+def releaseFromOsRelease(fn):
+ relName = None
+ relVer = None
+
+ def unquote(s):
+ if s[0] == "\"" or s[0] == "\'":
+ s = s[1:]
+
+ if s[-1] == "\"" or s[-1] == "\'":
+ s = s[:-1]
+
+ return s
+
+ with open(fn, "r") as f:
+ parser = shlex.shlex(f)
+
+ while True:
+ key = parser.get_token()
+ if key == parser.eof:
+ break
+ elif key == "NAME":
+ # Throw away the "=".
+ parser.get_token()
+ relName = unquote(parser.get_token())
+ elif key == "VERSION_ID":
+ # Throw away the "=".
+ parser.get_token()
+ relVer = unquote(parser.get_token())
+
+ return (relName, relVer)
+
def getReleaseString():
relName = None
relVer = None
@@ -2973,19 +3025,11 @@ def getReleaseString():
filename = "%s/etc/redhat-release" % ROOT_PATH
if os.access(filename, os.R_OK):
- with open(filename) as f:
- try:
- relstr = f.readline().strip()
- except (IOError, AttributeError):
- relstr = ""
-
- # get the release name and version
- # assumes that form is something
- # like "Red Hat Linux release 6.2 (Zoot)"
- (product, sep, version) = relstr.partition(" release ")
- if sep:
- relName = product
- relVer = version.split()[0]
+ (relName, relVer) = releaseFromRedhatRelease(filename)
+ else:
+ filename = "%s/etc/os-release" % ROOT_PATH
+ if os.access(filename, os.R_OK):
+ (relName, relVer) = releaseFromOsRelease(filename)
return (relArch, relName, relVer)
--
1.8.3.1
10 years, 3 months
[master/rhel7-branch] Set mandatory property in network tui spoke. (#1064139)
by Samantha N. Bueno
This reverts commit 9d312582 and employs a more correct fix that
is also present in the graphical logic -- determining whether
network configuration should be mandatory based on the installation
source method.
Resolves: rhbz#1064139
---
pyanaconda/ui/tui/spokes/network.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/network.py b/pyanaconda/ui/tui/spokes/network.py
index c0d11ab..8fc3d63 100644
--- a/pyanaconda/ui/tui/spokes/network.py
+++ b/pyanaconda/ui/tui/spokes/network.py
@@ -68,9 +68,15 @@ class NetworkSpoke(EditTUISpoke):
check if we're installing from CD/DVD, since a network connection
should not be required in this case.
"""
- localinst = bool(self.data.method.method == "cdrom")
return (not can_touch_runtime_system("require network connection")
- or nm_activated_devices() or localinst)
+ or nm_activated_devices())
+
+ @property
+ def mandatory(self):
+ """ This spoke should only be necessary if we're using an installation
+ source that requires a network connection.
+ """
+ return self.data.method.method in ("url", "nfs")
@property
def status(self):
--
1.8.3.1
10 years, 3 months
[master/rhel7] Check initrd size on ppc64 and warn (#1060691)
by Brian C. Lane
ppc64 initrd cannot be larger than 32MiB, so log a warning if it is too
large.
Related: rhbz#1060691
---
src/pylorax/treebuilder.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py
index 2bf3a31..0ae1bc3 100644
--- a/src/pylorax/treebuilder.py
+++ b/src/pylorax/treebuilder.py
@@ -214,6 +214,13 @@ class TreeBuilder(object):
os.rename(initrd, initrd + backup)
cmd = dracut + [outfile, kernel.version]
runcmd(cmd, root=self.vars.inroot)
+
+ # ppc64 cannot boot images > 32MiB, check size and warn
+ if self.vars.arch.basearch == "ppc64" and os.path.exists(outfile):
+ st = os.stat(outfile)
+ if st.st_size > 32 * 1024 * 1024:
+ logging.warning("ppc64 initrd %s is > 32MiB", outfile)
+
os.unlink(joinpaths(self.vars.inroot,"/proc/modules"))
def build(self):
--
1.8.5.3
10 years, 3 months