[PATCH] If a message is for a spoke not on the current hub, throw it away.
by Chris Lumens
This is an attempt to solve this problem (condensed):
DEBUG anaconda: _autoContinue clicking continue button
DEBUG anaconda: Left hub: SummaryHub
DEBUG anaconda: Entered hub: ProgressHub
INFO anaconda: Running Thread: AnaInstallThread (139961321248512)
DEBUG anaconda: spoke is ready: <pyanaconda.ui.gui.spokes.source.SourceSpoke object at 0x7f4b5c6fcc10>
DEBUG anaconda: _autoContinue clicking continue button
INFO program: Running... systemctl --no-wall poweroff
Basically, for whatever reason the source spoke is saying it's ready twice
and the second message gets processed after we've moved to the progress
hub. Each time this message gets processed, we find there's nothing else
to wait on and we should click the continue button. Unfortunately, the
second time we click the continue button, there are no more actions so
anaconda thinks it's time to shut down.
So, just check if the spoke that sent the message is even displayed on
the hub that is currently shown. If not, throw the message away.
Since this problem is hard to expose (it's only happened to me during live
image building a couple of times), I can't really test if this fixes it.
However, I don't see how it can do more harm except perhaps to the custom
part spoke. But I don't think there either.
---
pyanaconda/ui/gui/hubs/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index 98b5e3f..4dc5c9d 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -260,7 +260,7 @@ class Hub(GUIObject, common.Hub):
# The first argument to all codes is the name of the spoke we are
# acting on. If no such spoke exists, throw the message away.
spoke = self._spokes.get(args[0], None)
- if not spoke:
+ if not spoke or spoke.name not in self._spokes:
q.task_done()
continue
--
1.9.3
9 years, 6 months
[PATCH] Find storage test cases automatically.
by Chris Lumens
---
tests/storage/run_storage_tests.py | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/tests/storage/run_storage_tests.py b/tests/storage/run_storage_tests.py
index 8a52730..370a40e 100755
--- a/tests/storage/run_storage_tests.py
+++ b/tests/storage/run_storage_tests.py
@@ -2,23 +2,26 @@
import os, sys
+from pyanaconda.ui.common import collect
+
if os.geteuid() != 0:
sys.stderr.write("You must be root to run the storage tests; skipping.\n")
# This return code tells the automake test driver that this test was skipped.
os._exit(77)
-from cases.bz1014545 import BZ1014545_TestCase
-from cases.bz1067707 import BZ1067707_TestCase
-from cases.reuse import PartitionReuse_TestCase, LVMReuse_TestCase, BTRFSReuse_TestCase, ThinpReuse_TestCase
+if "top_srcdir" not in os.environ:
+ sys.stderr.write("$top_srcdir must be defined in the test environment\n")
+ # This return code tells the automake test driver that the test setup failed
+ sys.exit(99)
failures = 0
-for tc in [PartitionReuse_TestCase(),
- LVMReuse_TestCase(),
- BTRFSReuse_TestCase(),
- ThinpReuse_TestCase(),
- BZ1014545_TestCase(),
- BZ1067707_TestCase()]:
- failures += tc.run()
+classes = collect("cases.%s",
+ os.path.abspath(os.path.join(os.environ["top_srcdir"], "tests/storage/cases/")),
+ lambda obj: getattr(obj, "desc", None) is not None)
+
+for tc in classes:
+ obj = tc()
+ failures += obj.run()
os._exit(failures)
--
1.9.3
9 years, 6 months
[PATCH] Add new storage test cases that reuse results of earlier autopart runs.
by Chris Lumens
This required adding some new storage component classes to make that reuse
work, and passing components around as objects instead of class names.
Along the way I also changed disk image names in existing tests to be more
distinctive, changed output to go to stderr for better reporting, and
started passing ksdata to the blivet object.
Note that run_storage_tests.py still has an obnoxious list of all test
cases to run - it's not yet discovering them for itself. I'll be fixing
that next.
---
tests/storage/cases/__init__.py | 112 ++++++++++++++++++----
tests/storage/cases/bz1014545.py | 34 ++++---
tests/storage/cases/bz1067707.py | 10 +-
tests/storage/cases/reuse.py | 187 +++++++++++++++++++++++++++++++++++++
tests/storage/run_storage_tests.py | 11 ++-
5 files changed, 318 insertions(+), 36 deletions(-)
create mode 100644 tests/storage/cases/reuse.py
diff --git a/tests/storage/cases/__init__.py b/tests/storage/cases/__init__.py
index 87882a9..c07a1ea 100644
--- a/tests/storage/cases/__init__.py
+++ b/tests/storage/cases/__init__.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
#
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013-2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
@@ -17,6 +17,8 @@
#
# Author: Chris Lumens <clumens(a)redhat.com>
+from __future__ import print_function
+
import logging
import os, sys
import re
@@ -27,6 +29,7 @@ blivet.util.set_up_logging()
blivet_log = logging.getLogger("blivet")
blivet_log.info(sys.argv[0])
+from pyanaconda.bootloader import BootLoaderError
from pyanaconda.installclass import DefaultInstall
from pyanaconda.kickstart import AnacondaKSHandler, AnacondaKSParser, doKickstartStorage
from pykickstart.errors import KickstartError
@@ -45,7 +48,6 @@ class TestCase(object):
Class attributes:
- components -- A list of TestCaseComponent classes.
desc -- A description of what this test is supposed to be
testing.
name -- An identifying string given to this TestCase.
@@ -54,13 +56,12 @@ class TestCase(object):
matching platforms. If the list is empty, it is assumed
to be valid for all platforms.
"""
- components = []
desc = ""
name = ""
platforms = []
def __init__(self):
- pass
+ self.components = []
def run(self):
"""Iterate over all components, running each, and collecting the
@@ -70,25 +71,23 @@ class TestCase(object):
failures = 0
if self.platforms and blivet.platform.getPlatform().__class__.__name__ not in self.platforms:
- print("Test %s skipped: not valid for this platform" % self.name)
+ print("Test %s skipped: not valid for this platform" % self.name, file=sys.stderr)
return
- for c in self.components:
- obj = c()
-
+ for obj in self.components:
try:
obj._run()
except FailedTest as e:
- print("Test %s-%s failed:\n\tExpected: %s\n\tGot: %s" % (self.name, obj.name, e.expected, e.got))
+ print("Test %s-%s failed:\n\tExpected: %s\n\tGot: %s" % (self.name, obj.name, e.expected, e.got), file=sys.stderr)
failures += 1
continue
- print("Test %s-%s succeeded" % (self.name, obj.name))
+ print("Test %s-%s succeeded" % (self.name, obj.name), file=sys.stderr)
successes += 1
- print("Test %s summary:" % self.name)
- print("\tSuccesses: %s" % successes)
- print("\tFailures: %s" % failures)
+ print("Test %s summary:" % self.name, file=sys.stderr)
+ print("\tSuccesses: %s" % successes, file=sys.stderr)
+ print("\tFailures: %s\n" % failures, file=sys.stderr)
return failures
class TestCaseComponent(object):
@@ -132,12 +131,12 @@ class TestCaseComponent(object):
"""
return ""
- def setupDisks(self):
+ def setupDisks(self, ksdata):
"""Create all disk images given by self.disksToCreate and initialize
the storage module. Subclasses may override this method, but they
should be sure to call the base method as well.
"""
- self._blivet = blivet.Blivet()
+ self._blivet = blivet.Blivet(ksdata=ksdata)
# blivet only sets up the bootloader in installer_mode. We don't
# want installer_mode, though, because that involves running lots
@@ -197,8 +196,6 @@ class TestCaseComponent(object):
# Set up disks/blivet.
try:
- self.setupDisks()
-
# Parse the kickstart using anaconda's parser, since it has more
# advanced error detection. This also requires having storage set
# up first.
@@ -207,10 +204,13 @@ class TestCaseComponent(object):
instClass = DefaultInstall()
+ self.setupDisks(parser.handler)
+
doKickstartStorage(self._blivet, parser.handler, instClass)
self._blivet.updateKSData()
+ self._blivet.devicetree.teardownAll()
self._blivet.doIt()
- except (KickstartError, StorageError) as e:
+ except (BootLoaderError, KickstartError, StorageError) as e:
# anaconda handles expected kickstart errors (like parsing busted
# input files) by printing the error and quitting. For testing, an
# error might be expected so we should compare the result here with
@@ -234,4 +234,78 @@ class TestCaseComponent(object):
if self.expectedExceptionType:
raise FailedTest(None, self.expectedExceptionType)
- return
+class ReusableTestCaseComponent(TestCaseComponent):
+ """A version of TestCaseComponent that does not remove its disk images
+ after use. In this way, a later TestCaseComponent can reuse them.
+ This is handy for test cases that need pre-existing partitioning.
+
+ See further comments in ReusingTestCaseComponent.
+ """
+
+ def tearDownDisks(self):
+ # Don't destroy disks here, since a later component will want to
+ # use them.
+ self._blivet.devicetree.teardownDiskImages()
+
+class ReusingTestCaseComponent(TestCaseComponent):
+ """A version of TestCaseComponent that reuses existing disk images
+ rather than create its own. It will, however, delete these disk images
+ after use.
+
+ This class knows which disk images to reuse by the reusedComponents
+ parameter passed in at object instantiation. This is a list of other
+ TestCaseComponent instances. This class will reuse all disk images
+ from each instance in that list, in the order given.
+
+ A typical pipeline of components would thus look like this:
+
+ class ComponentA(ReusableTestCaseComponent):
+ ...
+
+ class ComponentB(ReusingTestCaseComponent):
+ ...
+
+ ComponentA -> ComponentB
+
+ A component may also derive from both, if it's in the middle of the
+ pipeline:
+
+ class ComponentA(ReusableTestCaseComponent):
+ ...
+
+ class ComponentB(ReusableTestCaseComponent, ReusingTestCaseComponent):
+ ...
+
+ class ComponentC(ReusingTestCaseComponent):
+ ...
+
+ ComponentA -> ComponentB -> ComponentC
+ """
+
+ def __init__(self, reusedComponents=None):
+ """Create a new ReusingTestCaseComponent. reusedComponents is a list
+ of other TestCaseComponent objects that this instance should make
+ use of. All disk images in that list will be used by this instance,
+ and all will be cleaned up at the end of the test.
+ """
+ TestCaseComponent.__init__(self)
+
+ if reusedComponents is None:
+ self._reusedComponents = []
+ else:
+ self._reusedComponents = reusedComponents
+
+ def setupDisks(self, ksdata):
+ self._blivet = blivet.Blivet(ksdata=ksdata)
+
+ # See comment in super class's method.
+ from pyanaconda.bootloader import get_bootloader
+ self._blivet._bootloader = get_bootloader()
+
+ for component in self._reusedComponents:
+ self._disks.update(component._disks)
+
+ for (name, image) in self._disks.items():
+ self._blivet.config.diskImages[name] = image
+
+ self._blivet.reset()
diff --git a/tests/storage/cases/bz1014545.py b/tests/storage/cases/bz1014545.py
index 6aa8ba1..1e652f5 100644
--- a/tests/storage/cases/bz1014545.py
+++ b/tests/storage/cases/bz1014545.py
@@ -17,6 +17,8 @@
#
# Author: Chris Lumens <clumens(a)redhat.com>
+__all__ = ["BZ1014545_TestCase"]
+
from . import TestCase, TestCaseComponent
from blivet.size import Size
@@ -27,14 +29,15 @@ class BTRFSOnNonBTRFSComponent(TestCaseComponent):
def __init__(self, *args, **kwargs):
TestCaseComponent.__init__(self, *args, **kwargs)
- self.disksToCreate = [("anatest-disk1", Size("1GiB"))]
+ self.disksToCreate = [("btrfs-on-non-btrfs-disk1", Size("1GiB"))]
@property
def ks(self):
return """
+bootloader --location=none
zerombr
clearpart --all --initlabel
-btrfs none --data=0 --metadata=1 anatest-disk1
+btrfs none --data=0 --metadata=1 btrfs-on-non-btrfs-disk1
"""
@property
@@ -43,21 +46,22 @@ btrfs none --data=0 --metadata=1 anatest-disk1
@property
def expectedExceptionText(self):
- return "BTRFS partition .* has incorrect format"
+ return "Btrfs partition .* has a format of \"disklabel\", but should have a format of \"btrfs\""
class VolGroupOnNonPVsComponent(TestCaseComponent):
name = "VolGroupOnNonPVs"
def __init__(self, *args, **kwargs):
TestCaseComponent.__init__(self, *args, **kwargs)
- self.disksToCreate = [("anatest-disk1", Size("1GiB"))]
+ self.disksToCreate = [("volgroup-on-non-pv-disk1", Size("1GiB"))]
@property
def ks(self):
return """
+bootloader --location=none
zerombr
clearpart --all --initlabel
-volgroup myvg anatest-disk1
+volgroup myvg volgroup-on-non-pv-disk1
"""
@property
@@ -66,22 +70,23 @@ volgroup myvg anatest-disk1
@property
def expectedExceptionText(self):
- return "Physical Volume .* has incorrect format"
+ return "Physical volume .* has a format of \"disklabel\", but should have a format of \"lvmpv\""
class RaidOnNonRaidMembersComponent(TestCaseComponent):
name = "RaidOnNonRaidMembers"
def __init__(self, *args, **kwargs):
TestCaseComponent.__init__(self, *args, **kwargs)
- self.disksToCreate = [("anatest-disk1", Size("1GiB")),
- ("anatest-disk2", Size("1GiB"))]
+ self.disksToCreate = [("raid-on-non-raid-disk1", Size("1GiB")),
+ ("raid-on-non-raid-disk2", Size("1GiB"))]
@property
def ks(self):
return """
+bootloader --location=none
zerombr
clearpart --all --initlabel
-raid / --level=1 --device=md0 anatest-disk1 anatest-disk2
+raid / --level=1 --device=md0 raid-on-non-raid-disk1 raid-on-non-raid-disk2
"""
@property
@@ -90,12 +95,9 @@ raid / --level=1 --device=md0 anatest-disk1 anatest-disk2
@property
def expectedExceptionText(self):
- return "RAID member .* has incorrect format"
+ return "RAID device .* has a format of \"disklabel\", but should have a format of \"mdmember\""
class BZ1014545_TestCase(TestCase):
- components = [BTRFSOnNonBTRFSComponent,
- RaidOnNonRaidMembersComponent,
- VolGroupOnNonPVsComponent]
name = "1014545"
desc = """The members of various commands must have the correct format.
For instance, raid members must have mdmember, and volgroup members must have
@@ -108,3 +110,9 @@ much further in installation - during bootloader installation. The real
bug is that this condition should be detected when the kickstart storage
commands are being converted to actions.
"""
+
+ def __init__(self):
+ TestCase.__init__(self)
+ self.components = [BTRFSOnNonBTRFSComponent(),
+ RaidOnNonRaidMembersComponent(),
+ VolGroupOnNonPVsComponent()]
diff --git a/tests/storage/cases/bz1067707.py b/tests/storage/cases/bz1067707.py
index e49e4fc..63b5de8 100644
--- a/tests/storage/cases/bz1067707.py
+++ b/tests/storage/cases/bz1067707.py
@@ -17,6 +17,8 @@
#
# Author: Chris Lumens <clumens(a)redhat.com>
+__all__ = ["BZ1067707_TestCase"]
+
from . import TestCase, TestCaseComponent
from blivet.size import Size
@@ -25,21 +27,25 @@ class SwapWithRecommendedSizeComponent(TestCaseComponent):
def __init__(self, *args, **kwargs):
TestCaseComponent.__init__(self, *args, **kwargs)
- self.disksToCreate = [("anatest-disk1", Size("1GiB"))]
+ self.disksToCreate = [("recommended-swap-disk1", Size("1GiB"))]
@property
def ks(self):
return """
+bootloader --location=none
zerombr
clearpart --all --initlabel
part swap --recommended
"""
class BZ1067707_TestCase(TestCase):
- components = [SwapWithRecommendedSizeComponent]
name = "1067707"
desc = """Partition lines do not necessarily require a size to be
specified. There are plenty of reasons why a user might not do this: putting
a filesystem on a given pre-existing partition, giving a resize or maxsize
option, or (in this case) asking for the recommended swap size.
"""
+
+ def __init__(self):
+ TestCase.__init__(self)
+ self.components = [SwapWithRecommendedSizeComponent()]
diff --git a/tests/storage/cases/reuse.py b/tests/storage/cases/reuse.py
new file mode 100644
index 0000000..ac02d58
--- /dev/null
+++ b/tests/storage/cases/reuse.py
@@ -0,0 +1,187 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2014 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published
+# by the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: Chris Lumens <clumens(a)redhat.com>
+
+__all__ = ["PartitionReuse_TestCase", "LVMReuse_TestCase", "BTRFSReuse_TestCase", "ThinpReuse_TestCase"]
+
+from . import TestCase, ReusableTestCaseComponent, ReusingTestCaseComponent
+from blivet.size import Size
+
+class FirstPartitionAutopartComponent(ReusableTestCaseComponent):
+ name = "FirstPartitionAutopart"
+
+ def __init__(self, *args, **kwargs):
+ ReusableTestCaseComponent.__init__(self, *args, **kwargs)
+ self.disksToCreate = [("part-autopart-disk1", Size("8GiB"))]
+
+ @property
+ def ks(self):
+ return """
+bootloader --location=none
+zerombr
+clearpart --all --initlabel
+autopart --type=plain
+"""
+
+class SecondPartitionAutopartComponent(ReusingTestCaseComponent):
+ name = "SecondPartitionAutopart"
+
+ @property
+ def ks(self):
+ return """
+bootloader --location=none
+zerombr
+clearpart --all --initlabel
+autopart --type=plain
+"""
+
+class PartitionReuse_TestCase(TestCase):
+ name = "PartitionReuse"
+ desc = """Test that a disk with pre-existing partitioning as a
+result of a previous installation with partition-based autopart works.
+"""
+
+ def __init__(self):
+ TestCase.__init__(self)
+ first = FirstPartitionAutopartComponent()
+ second = SecondPartitionAutopartComponent(reusedComponents=[first])
+
+ self.components = [first, second]
+
+class FirstLVMAutopartComponent(ReusableTestCaseComponent):
+ name = "FirstLVMAutopart"
+
+ def __init__(self, *args, **kwargs):
+ ReusableTestCaseComponent.__init__(self, *args, **kwargs)
+ self.disksToCreate = [("lvm-autopart-disk1", Size("8GiB"))]
+
+ @property
+ def ks(self):
+ return """
+bootloader --location=none
+zerombr
+clearpart --all --initlabel
+autopart --type=lvm
+"""
+
+class SecondLVMAutopartComponent(ReusingTestCaseComponent):
+ name = "SecondLVMAutopart"
+
+ @property
+ def ks(self):
+ return """
+bootloader --location=none
+zerombr
+clearpart --all --initlabel
+autopart --type=lvm
+"""
+
+class LVMReuse_TestCase(TestCase):
+ name = "LVMReuse"
+ desc = """Test that a disk with pre-existing LVM partitioning as a
+result of a previous installation with LVM-based autopart works.
+"""
+
+ def __init__(self):
+ TestCase.__init__(self)
+ first = FirstLVMAutopartComponent()
+ second = SecondLVMAutopartComponent(reusedComponents=[first])
+
+ self.components = [first, second]
+
+class FirstBTRFSAutopartComponent(ReusableTestCaseComponent):
+ name = "FirstBTRFSAutopart"
+
+ def __init__(self, *args, **kwargs):
+ ReusableTestCaseComponent.__init__(self, *args, **kwargs)
+ self.disksToCreate = [("btrfs-autopart-disk1", Size("8GiB"))]
+
+ @property
+ def ks(self):
+ return """
+bootloader --location=none
+zerombr
+clearpart --all --initlabel
+autopart --type=btrfs
+"""
+
+class SecondBTRFSAutopartComponent(ReusingTestCaseComponent):
+ name = "SecondBTRFSAutopart"
+
+ @property
+ def ks(self):
+ return """
+bootloader --location=none
+zerombr
+clearpart --all --initlabel
+autopart --type=btrfs
+"""
+
+class BTRFSReuse_TestCase(TestCase):
+ name = "BTRFSReuse"
+ desc = """Test that a disk with pre-existing BTRFS partitioning as a
+result of a previous installation with BTRFS-based autopart works.
+"""
+
+ def __init__(self):
+ TestCase.__init__(self)
+ first = FirstBTRFSAutopartComponent()
+ second = SecondBTRFSAutopartComponent(reusedComponents=[first])
+
+ self.components = [first, second]
+
+class FirstThinpAutopartComponent(ReusableTestCaseComponent):
+ name = "FirstThinpAutopart"
+
+ def __init__(self, *args, **kwargs):
+ ReusableTestCaseComponent.__init__(self, *args, **kwargs)
+ self.disksToCreate = [("thinp-autopart-disk1", Size("8GiB"))]
+
+ @property
+ def ks(self):
+ return """
+bootloader --location=none
+zerombr
+clearpart --all --initlabel
+autopart --type=thinp
+"""
+
+class SecondThinpAutopartComponent(ReusingTestCaseComponent):
+ name = "SecondThinpAutopart"
+
+ @property
+ def ks(self):
+ return """
+bootloader --location=none
+zerombr
+clearpart --all --initlabel
+autopart --type=thinp
+"""
+
+class ThinpReuse_TestCase(TestCase):
+ name = "ThinpReuse"
+ desc = """Test that a disk with pre-existing thinp partitioning as a
+result of a previous installation with thinp autopart works.
+"""
+
+ def __init__(self):
+ TestCase.__init__(self)
+ first = FirstThinpAutopartComponent()
+ second = SecondThinpAutopartComponent(reusedComponents=[first])
+
+ self.components = [first, second]
diff --git a/tests/storage/run_storage_tests.py b/tests/storage/run_storage_tests.py
index ef155e0..8a52730 100755
--- a/tests/storage/run_storage_tests.py
+++ b/tests/storage/run_storage_tests.py
@@ -9,9 +9,16 @@ if os.geteuid() != 0:
from cases.bz1014545 import BZ1014545_TestCase
from cases.bz1067707 import BZ1067707_TestCase
+from cases.reuse import PartitionReuse_TestCase, LVMReuse_TestCase, BTRFSReuse_TestCase, ThinpReuse_TestCase
-for tc in [BZ1014545_TestCase(),
+failures = 0
+
+for tc in [PartitionReuse_TestCase(),
+ LVMReuse_TestCase(),
+ BTRFSReuse_TestCase(),
+ ThinpReuse_TestCase(),
+ BZ1014545_TestCase(),
BZ1067707_TestCase()]:
- failures = tc.run()
+ failures += tc.run()
os._exit(failures)
--
1.9.3
9 years, 6 months
[blivet:master 0/2] Add a new pylint checker
by Anne Mulhern
And then use it.
This change should have the result that every assignment to a class
attribute in a class is required because it overrides the assignment
in the parent class with a different value.
mulhern (2):
Add a simple pylint checker for pointless class attribute overrides.
Remove pointless class attribute overrides.
blivet/formats/biosboot.py | 1 -
blivet/formats/disklabel.py | 1 -
blivet/formats/dmraid.py | 3 -
blivet/formats/fs.py | 10 ----
blivet/formats/luks.py | 1 -
blivet/formats/multipath.py | 3 -
blivet/formats/prepboot.py | 1 -
tests/pylint/pointless-override.py | 120 +++++++++++++++++++++++++++++++++++++
tests/pylint/pylint-one.sh | 2 +-
9 files changed, 121 insertions(+), 21 deletions(-)
create mode 100644 tests/pylint/pointless-override.py
--
1.9.3
9 years, 6 months
[rhel7/master] Skip tui askvnc reboot for dirinstall (#1164254)
by Brian C. Lane
When running with --dirinstall, or image or live we don't want to reboot
the system when quitting tui mode. Normally this is handled by the
exitHandler, but askvnc is too early for that to work.
Resolves: rhbz#1164254
---
pyanaconda/ui/tui/spokes/askvnc.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/askvnc.py b/pyanaconda/ui/tui/spokes/askvnc.py
index 52548f4..af1c9a5 100644
--- a/pyanaconda/ui/tui/spokes/askvnc.py
+++ b/pyanaconda/ui/tui/spokes/askvnc.py
@@ -22,8 +22,10 @@
from pyanaconda.ui.tui.spokes import NormalTUISpoke
from pyanaconda.ui.tui.simpleline import TextWidget, ColumnWidget
from pyanaconda.ui.tui.tuiobject import YesNoDialog
-from pyanaconda.constants import USEVNC, USETEXT
+from pyanaconda import iutil
+from pyanaconda.constants import USEVNC, USETEXT, IPMI_ABORTED
from pyanaconda.i18n import N_, _
+from pyanaconda.flags import can_touch_runtime_system
import getpass, subprocess
class AskVNCSpoke(NormalTUISpoke):
@@ -88,7 +90,11 @@ class AskVNCSpoke(NormalTUISpoke):
d = YesNoDialog(self.app, _(self.app.quit_message))
self.app.switch_screen_modal(d)
if d.answer:
- subprocess.Popen(["systemctl", "--no-wall", "reboot"])
+ iutil.ipmi_report(IPMI_ABORTED)
+ if can_touch_runtime_system("Quit and Reboot"):
+ subprocess.Popen(["systemctl", "--no-wall", "reboot"])
+ else:
+ exit(1)
else:
return key
--
1.9.3
9 years, 6 months
[rhel7] Fix a bad cherry-pick in an error handler
by David Shea
Related: rhbz#1057032
---
pyanaconda/errors.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py
index e2da7f1..c7197e8 100644
--- a/pyanaconda/errors.py
+++ b/pyanaconda/errors.py
@@ -254,8 +254,9 @@ class ErrorHandler(object):
self.ui.showDetailedError(message, details)
return ERROR_RAISE
- def _passwordCryptErrorHandler(self, exn):
- message = _("Unable to encrypt password: unsupported algorithm %s") % exn.algo
+ def _passwordCryptErrorHandler(self, *args, **kwargs):
+ message = _("Unable to encrypt password: unsupported algorithm %s") % \
+ kwargs["exception"].algo
self.ui.showError(message)
return ERROR_RAISE
--
2.1.0
9 years, 6 months
[blivet:master 0/2] A couple of small pylint inspired patches.
by Anne Mulhern
The first was inspired by a class of pylint errors, the C (Convention) ones
that are disabled in our tests. I happened to run pylint-gui for fun and this
one popped out at me by pure luck.
However, if the C error were undisabled there would be about
3000 new errors, mostly quite pointless, about too-long-lines and missing-
docstrings.
The one that made me notice bug in patch (1) was the superfluous-parens
error. There are 55 other instances of just this, but they all appear benign.
Fixing them wouldn't be hard, but it would be a busy commit with no real
useful affect.
So I'm leaving the C errors disabled.
mulhern (2):
Match whole string, not substring.
Remove redundant import.
blivet/arch.py | 2 +-
tests/size_test.py | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
--
1.9.3
9 years, 6 months
[master/f21] Remove diagnostic product.img test
by Brian C. Lane
Yeah. Pushed my test template on accident. Sorry about that.
---
share/runtime-postinstall.tmpl | 3 ---
1 file changed, 3 deletions(-)
diff --git a/share/runtime-postinstall.tmpl b/share/runtime-postinstall.tmpl
index 5bf98f6..217cca6 100644
--- a/share/runtime-postinstall.tmpl
+++ b/share/runtime-postinstall.tmpl
@@ -119,7 +119,4 @@ append etc/lvm/lvm.conf "global {\n\tuse_lvmetad = 1\n}\n"
## Record the package versions used to create the image
runcmd chroot ${root} /bin/rpm -qa --pipe "tee /root/lorax-packages.log"
-mkdir usr/share/lorax/product/run/install/product/pyanaconda/installclasses/
-append usr/share/lorax/product/run/install/product/pyanaconda/installclasses/custom.py "import logging\nlog = logging.getLogger('anaconda')\nlog.info('bcl was here')\n"
-
## TODO: we could run prelink here if we wanted?
--
1.9.3
9 years, 6 months
[PATCH] Mountpoint detection for removable devices
by Vojtěch Trefný
---
Removable devices are mounted with '-o nodev' by default.
blivet/devicetree.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 7f3f73a..543eb44 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -2492,6 +2492,8 @@ class DeviceTree(object):
break
elif options and "nodev" in options.split(","):
device = self.getDeviceByName(devspec)
+ if not device:
+ device = self.getDeviceByPath(devspec)
else:
if not devspec.startswith("/dev/"):
device = self.getDeviceByName(devspec)
--
2.1.0
9 years, 6 months