[firstboot][PATCH] Don't panic if there are no modules found (#1026941)
by Vratislav Podzimek
If there are no modules found, we should just skip running the UI session and
exit silently.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
progs/firstboot | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/progs/firstboot b/progs/firstboot
index 1ad7e31..59d3484 100755
--- a/progs/firstboot
+++ b/progs/firstboot
@@ -121,19 +121,16 @@ if __name__ == '__main__':
modules = loader.load_modules(module_dir=opts.module_dir,
reconfig=opts.reconfig)
- if not modules:
- err = 'no modules found'
- raise RuntimeError(err)
-
- # TODO rewrite the interface
- config.interface.moduleList = modules
- config.interface.createMainWindow()
- config.interface.createScreens()
- config.interface.createSidebar()
- config.interface.run()
-
- if frontend is not None:
- frontend.kill()
+ if modules:
+ # TODO rewrite the interface
+ config.interface.moduleList = modules
+ config.interface.createMainWindow()
+ config.interface.createScreens()
+ config.interface.createSidebar()
+ config.interface.run()
+
+ if frontend is not None:
+ frontend.kill()
if not opts.test:
with open('/etc/sysconfig/firstboot', 'w') as f:
--
1.8.3.1
10 years, 6 months
[master][PATCH] Add tests for iutil
by Martin Kolman
Add tests for almost all functions in iutil.
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
tests/pyanaconda_tests/iutil_test.py | 402 ++++++++++++++++++++++++++++++-
tests/pyanaconda_tests/test_constants.py | 3 +
2 files changed, 404 insertions(+), 1 deletion(-)
create mode 100644 tests/pyanaconda_tests/test_constants.py
diff --git a/tests/pyanaconda_tests/iutil_test.py b/tests/pyanaconda_tests/iutil_test.py
index aa1f6c0..692671c 100644
--- a/tests/pyanaconda_tests/iutil_test.py
+++ b/tests/pyanaconda_tests/iutil_test.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Red Hat, Inc.
#
@@ -16,12 +17,26 @@
# Red Hat, Inc.
#
# Red Hat Author(s): Vratislav Podzimek <vpodzime(a)redhat.com>
-#
+# Martin Kolman <mkolman(a)redhat.com>
from pyanaconda import iutil
import unittest
+import types
+import os
+import shutil
+from test_constants import ANACONDA_TEST_DIR
class UpcaseFirstLetterTests(unittest.TestCase):
+
+ def setUp(self):
+ # create the directory used for file/folder tests
+ if not os.path.exists(ANACONDA_TEST_DIR):
+ os.makedirs(ANACONDA_TEST_DIR)
+
+ def tearDown(self):
+ # remove the testing directory
+ shutil.rmtree(ANACONDA_TEST_DIR)
+
def upcase_first_letter_test(self):
"""Upcasing first letter should work as expected."""
@@ -39,3 +54,388 @@ class UpcaseFirstLetterTests(unittest.TestCase):
# no lowercase
self.assertEqual(iutil.upcase_first_letter("czech Republic"),
"Czech Republic")
+
+class RunProgramTests(unittest.TestCase):
+ def run_program_test(self):
+ """Test the _run_program method."""
+
+ # correct calling should return rc==0
+ self.assertEqual(iutil._run_program(['ls'])[0], 0)
+
+ # incorrect calling should return rc!=0
+ self.assertNotEqual(iutil._run_program(['ls', '--asdasd'])[0], 0)
+
+ # check if an int is returned for bot success and error
+ self.assertIsInstance(iutil._run_program(['ls'])[0], int)
+ self.assertIsInstance(iutil._run_program(['ls', '--asdasd'])[0], int)
+
+ # error should raise OSError
+ with self.assertRaises(OSError):
+ iutil._run_program(['asdasdadasd'])
+
+ def exec_with_redirect_test(self):
+ """Test execWithRedirect."""
+ # correct calling should return rc==0
+ self.assertEqual(iutil.execWithRedirect('ls', []), 0)
+
+ # incorrect calling should return rc!=0
+ self.assertNotEqual(iutil.execWithRedirect('ls', ['--asdasd']), 0)
+
+ def exec_with_capture_test(self):
+ """Test execWithCapture."""
+
+ # check some output is returned
+ self.assertGreater(len(iutil.execWithCapture('ls', ['--help'])), 0)
+
+ # check no output is returned
+ self.assertEqual(len(iutil.execWithCapture('true', [])), 0)
+
+ def exec_readlines_test(self):
+ """Test execReadlines."""
+
+ # test no lines are returned
+ self.assertEqual(list(iutil.execReadlines("true", [])), [])
+
+ # test some lines are returned
+ self.assertGreater(len(list(iutil.execReadlines("ls", ["--help"]))), 0)
+
+ # check that it always returns a generator for both
+ # if there is some output and if there isn't any
+ self.assertIsInstance(iutil.execReadlines("ls", ["--help"]),
+ types.GeneratorType)
+ self.assertIsInstance(iutil.execReadlines("true", []),
+ types.GeneratorType)
+
+ def get_dir_size_test(self):
+ """Test the getDirSize."""
+
+ # dev null should have a size == 0
+ self.assertEqual(iutil.getDirSize('/dev/null'), 0)
+
+ # incorrect path should also return 0
+ self.assertEqual(iutil.getDirSize('/dev/null/foo'), 0)
+
+ # check if an int is always returned
+ self.assertIsInstance(iutil.getDirSize('/dev/null'), int)
+ self.assertIsInstance(iutil.getDirSize('/dev/null/foo'), int)
+
+ # TODO: mock some dirs and check if their size is
+ # computed correctly
+
+ def mkdir_chain_test(self):
+ """Test mkdirChain."""
+
+ # don't fail if directory path already exists
+ iutil.mkdirChain('/dev/null')
+ iutil.mkdirChain('/')
+ iutil.mkdirChain('/tmp')
+
+ # create a path and test it exists
+ test_folder = "test_mkdir_chain"
+ test_paths = [
+ "foo",
+ "foo/bar/baz",
+ u"foo/bar/baz",
+ "",
+ "čřščščřščř",
+ u"čřščščřščř",
+ "asdasd asdasd",
+ "! spam"
+ ]
+
+ # join with the toplevel test folder and the folder for this
+ # test
+ test_paths = [os.path.join(ANACONDA_TEST_DIR, test_folder, p)
+ for p in test_paths]
+
+ def create_return(path):
+ iutil.mkdirChain(path)
+ return path
+
+ # create the folders and check that they exist
+ for p in test_paths:
+ self.assertTrue(os.path.exists(create_return(p)))
+
+ # try to create them again - all the paths should already exist
+ # and the mkdirChain function needs to handle that
+ # without a traceback
+ for p in test_paths:
+ iutil.mkdirChain(p)
+
+ def get_active_console_test(self):
+ """Test get_active_console."""
+
+ # at least check if a string is returned
+ self.assertIsInstance(iutil.get_active_console(), str)
+
+ def is_console_on_vt_test(self):
+ """Test isConsoleOnVirtualTerminal."""
+
+ # at least check if a bool is returned
+ self.assertIsInstance(iutil.isConsoleOnVirtualTerminal(), bool)
+
+ def strip_markup_test(self):
+ """Test strip_markup."""
+
+ # list of tuples representing a markup and its correct parsing
+ markups = [
+ ("", ""),
+ ("a", "a"),
+ ("č", "č"),
+ ("<č>", ""),
+ ("<a>", ""),
+ ("<a><a>", ""),
+ ("<a></a>", ""),
+ ("<a>abc</a>", "abc"),
+ ("<abc", ""), # unclosed tag
+ ("a>bc", "a>bc"), # not a valid tag
+ ("<i><b>bold</b></i>", "bold"), # nesting
+ ("<p><b>bold</b> <i>italic</i></p>", "bold italic"),
+ (" <a>text</a>", " text"),
+ (" <a> </a> ", " "),
+ ('<span color="blue">text</span>', 'text'),
+ ("<<<<<<<<<<<<<<<", ""),
+ ]
+
+ # check if markup is parsed properly
+ for markup, output in markups:
+ self.assertEqual(iutil.strip_markup(markup), output)
+
+ def parse_nfs_url_test(self):
+ """Test parseNfsUrl."""
+
+ # empty NFS url should return 3 blanks
+ self.assertEqual(iutil.parseNfsUrl(""), ("", "", ""))
+
+ # the string is delimited by :, there is one prefix and 3 parts,
+ # the prefix is discarded and all parts after the 3th part
+ # are also discarded
+ self.assertEqual(iutil.parseNfsUrl("discard:options:host:path"),
+ ("options", "host", "path"))
+ self.assertEqual(iutil.parseNfsUrl("discard:options:host:path:foo:bar"),
+ ("options", "host", "path"))
+ self.assertEqual(iutil.parseNfsUrl(":options:host:path::"),
+ ("options", "host", "path"))
+ self.assertEqual(iutil.parseNfsUrl(":::::"),
+ ("", "", ""))
+
+ # if there is only prefix & 2 parts,
+ # the two parts are host and path
+ self.assertEqual(iutil.parseNfsUrl("prefix:host:path"),
+ ("", "host", "path"))
+ self.assertEqual(iutil.parseNfsUrl(":host:path"),
+ ("", "host", "path"))
+ self.assertEqual(iutil.parseNfsUrl("::"),
+ ("", "", ""))
+
+ # if there is only a prefix and single part,
+ # the part is the host
+
+ self.assertEqual(iutil.parseNfsUrl("prefix:host"),
+ ("", "host", ""))
+ self.assertEqual(iutil.parseNfsUrl(":host"),
+ ("", "host", ""))
+ self.assertEqual(iutil.parseNfsUrl(":"),
+ ("", "", ""))
+
+ def vt_activate_test(self):
+ """Test vtActivate."""
+
+ # pylint: disable-msg=E1101
+
+ def raise_os_error(*args, **kwargs):
+ raise OSError
+
+ # chvt does not exist on all platforms
+ # and the function needs to correctly survie that
+ iutil.vtActivate.func_globals['execWithRedirect'] = raise_os_error
+
+ self.assertEqual(iutil.vtActivate(2), False)
+
+ def get_deep_attr_test(self):
+ """Test getdeepattr."""
+
+ # pylint: disable-msg=W0201
+
+ class O(object):
+ pass
+
+ a = O()
+ a.b = O()
+ a.b1 = 1
+ a.b.c = 2
+ a.b.c1 = "ř"
+
+ self.assertEqual(iutil.getdeepattr(a, "b1"), 1)
+ self.assertEqual(iutil.getdeepattr(a, "b.c"), 2)
+ self.assertEqual(iutil.getdeepattr(a, "b.c1"), "ř")
+
+ # be consistent with getattr and throw
+ # AttributeError if non-existent attribute is requested
+ with self.assertRaises(AttributeError):
+ iutil.getdeepattr(a, "")
+ with self.assertRaises(AttributeError):
+ iutil.getdeepattr(a, "b.c.d")
+
+ def set_deep_attr_test(self):
+ """Test setdeepattr."""
+
+ # pylint: disable-msg=W0201
+ # pylint: disable-msg=E1101
+
+ class O(object):
+ pass
+
+ a = O()
+ a.b = O()
+ a.b1 = 1
+ a.b.c = O()
+ a.b.c1 = "ř"
+
+ # set to a new attribute
+ iutil.setdeepattr(a, "b.c.d", True)
+ self.assertEqual(a.b.c.d, True)
+
+ # override existing attribute
+ iutil.setdeepattr(a, "b.c", 1234)
+ self.assertEqual(a.b.c, 1234)
+
+ # "" is actually a valid attribute name
+ # that can be only accessed by getattr
+ iutil.setdeepattr(a, "", 1234)
+ self.assertEqual(getattr(a, ""), 1234)
+
+ iutil.setdeepattr(a, "b.", 123)
+ self.assertEqual(iutil.getdeepattr(a, "b."), 123)
+
+ # error should raise AttributeError
+ with self.assertRaises(AttributeError):
+ iutil.setdeepattr(a, "b.c.d.e.f.g.h", 1234)
+
+ def strip_accents_test(self):
+ """Test strip_accents."""
+
+ # string needs to be Unicode,
+ # otherwise TypeError is raised
+ with self.assertRaises(TypeError):
+ iutil.strip_accents("")
+ with self.assertRaises(TypeError):
+ iutil.strip_accents("abc")
+ with self.assertRaises(TypeError):
+ iutil.strip_accents("ěščřžýáíé")
+
+ # empty Unicode string
+ self.assertEquals(iutil.strip_accents(u""), u"")
+
+ # some Czech accents
+ self.assertEquals(iutil.strip_accents(u"ěščřžýáíéúů"), u"escrzyaieuu")
+ self.assertEquals(iutil.strip_accents(u"v češtině"), u"v cestine")
+ self.assertEquals(iutil.strip_accents(u"měšťánek rozšíří HÁČKY"),
+ u"mestanek rozsiri HACKY")
+ self.assertEquals(iutil.strip_accents(u"nejneobhospodařovávatelnějšímu"),
+ u"nejneobhospodarovavatelnejsimu")
+
+ # some German umlauts
+ self.assertEquals(iutil.strip_accents(u"Lärmüberhörer"), u"Larmuberhorer")
+ self.assertEquals(iutil.strip_accents(u"Heizölrückstoßabdämpfung"),
+ u"Heizolrucksto\xdfabdampfung")
+
+ # some Japanese
+ self.assertEquals(iutil.strip_accents(u"日本語"), u"\u65e5\u672c\u8a9e")
+ self.assertEquals(iutil.strip_accents(u"アナコンダ"), # Anaconda
+ u"\u30a2\u30ca\u30b3\u30f3\u30bf")
+
+ # combined
+ input_string = u"ASCI měšťánek アナコンダ Heizölrückstoßabdämpfung"
+ output_string =u"ASCI mestanek \u30a2\u30ca\u30b3\u30f3\u30bf Heizolrucksto\xdfabdampfung"
+ self.assertEquals(iutil.strip_accents(input_string), output_string)
+
+ def cmp_obj_attrs_test(self):
+ """Test cmp_obj_attrs."""
+
+ # pylint: disable-msg=W0201
+
+ class O(object):
+ pass
+
+ a = O()
+ a.b = 1
+ a.c = 2
+
+ a1 = O()
+ a1.b = 1
+ a1.c = 2
+
+ b = O()
+ b.b = 1
+ b.c = 3
+
+ # a class should have it's own attributes
+ self.assertTrue(iutil.cmp_obj_attrs(a, a, ["b", "c"]))
+ self.assertTrue(iutil.cmp_obj_attrs(a1, a1, ["b", "c"]))
+ self.assertTrue(iutil.cmp_obj_attrs(b, b, ["b", "c"]))
+
+ # a and a1 should have the same attributes
+ self.assertTrue(iutil.cmp_obj_attrs(a, a1, ["b", "c"]))
+ self.assertTrue(iutil.cmp_obj_attrs(a1, a, ["b", "c"]))
+ self.assertTrue(iutil.cmp_obj_attrs(a1, a, ["c", "b"]))
+
+ # missing attributes are considered a mismatch
+ self.assertFalse(iutil.cmp_obj_attrs(a, a1, ["b", "c", "d"]))
+
+ # empty attribute list is not a mismatch
+ self.assertTrue(iutil.cmp_obj_attrs(a, b, []))
+
+ # attributes of a and b differ
+ self.assertFalse(iutil.cmp_obj_attrs(a, b, ["b", "c"]))
+ self.assertFalse(iutil.cmp_obj_attrs(b, a, ["b", "c"]))
+ self.assertFalse(iutil.cmp_obj_attrs(b, a, ["c", "b"]))
+
+ def to_ascii_test(self):
+ """Test _toASCII."""
+
+ # works with strings only, chokes on Unicode strings
+ with self.assertRaises(ValueError):
+ iutil._toASCII(u" ")
+ with self.assertRaises(ValueError):
+ iutil._toASCII(u"ABC")
+ with self.assertRaises(ValueError):
+ iutil._toASCII(u"Heizölrückstoßabdämpfung")
+
+ # but empty Unicode string is fine :)
+ iutil._toASCII(u"")
+
+ # check some conversions
+ self.assertEqual(iutil._toASCII(""), "")
+ self.assertEqual(iutil._toASCII(" "), " ")
+ self.assertEqual(iutil._toASCII("&@`'łŁ!@#$%^&*{}[]$'<>*"),
+ "&@`'\xc5\x82\xc5\x81!@#$%^&*{}[]$'<>*")
+ self.assertEqual(iutil._toASCII("ABC"), "ABC")
+ self.assertEqual(iutil._toASCII("aBC"), "aBC")
+ _out = "Heiz\xc3\xb6lr\xc3\xbccksto\xc3\x9fabd\xc3\xa4mpfung"
+ self.assertEqual(iutil._toASCII("Heizölrückstoßabdämpfung"), _out)
+
+ def upper_ascii_test(self):
+ """Test upperASCII."""
+
+ self.assertEqual(iutil.upperASCII(""),"")
+ self.assertEqual(iutil.upperASCII("a"),"A")
+ self.assertEqual(iutil.upperASCII("A"),"A")
+ self.assertEqual(iutil.upperASCII("aBc"),"ABC")
+ self.assertEqual(iutil.upperASCII("_&*'@#$%^aBcžčŘ"),
+ "_&*'@#$%^ABC\xc5\xbe\xc4\x8d\xc5\x98")
+ _out = "HEIZ\xc3\xb6LR\xc3\xbcCKSTO\xc3\x9fABD\xc3\xa4MPFUNG"
+ self.assertEqual(iutil.upperASCII("Heizölrückstoßabdämpfung"), _out)
+
+
+ def lower_ascii_test(self):
+ """Test lowerASCII."""
+ self.assertEqual(iutil.lowerASCII(""),"")
+ self.assertEqual(iutil.lowerASCII("A"),"a")
+ self.assertEqual(iutil.lowerASCII("a"),"a")
+ self.assertEqual(iutil.lowerASCII("aBc"),"abc")
+ self.assertEqual(iutil.lowerASCII("_&*'@#$%^aBcžčŘ"),
+ "_&*'@#$%^abc\xc5\xbe\xc4\x8d\xc5\x98")
+ _out = "heiz\xc3\xb6lr\xc3\xbccksto\xc3\x9fabd\xc3\xa4mpfung"
+ self.assertEqual(iutil.lowerASCII("Heizölrückstoßabdämpfung"), _out)
+
diff --git a/tests/pyanaconda_tests/test_constants.py b/tests/pyanaconda_tests/test_constants.py
new file mode 100644
index 0000000..5a25e54
--- /dev/null
+++ b/tests/pyanaconda_tests/test_constants.py
@@ -0,0 +1,3 @@
+# constants for use in tests
+
+ANACONDA_TEST_DIR = '/tmp/anaconda_tests_dir'
--
1.8.3.1
10 years, 6 months
[rhel7-branch] Display a EULA-related warning on TUI progress hub at end of installation. (#909309)
by Samantha N. Bueno
(Ignore the other one.)
Related: rhbz#909309
---
pyanaconda/constants.py | 1 +
pyanaconda/ui/tui/hubs/progress.py | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
index 9b081fb..cf8a8ea 100644
--- a/pyanaconda/constants.py
+++ b/pyanaconda/constants.py
@@ -50,6 +50,7 @@ productVersion = product.productVersion
productArch = product.productArch
bugzillaUrl = product.bugUrl
isFinal = product.isFinal
+eulaLocation = "/usr/share/redhat-release/EULA"
# for use in device names, eg: "fedora", "rhel"
shortProductName = productName.lower()
diff --git a/pyanaconda/ui/tui/hubs/progress.py b/pyanaconda/ui/tui/hubs/progress.py
index 90d5731..b4bdf94 100644
--- a/pyanaconda/ui/tui/hubs/progress.py
+++ b/pyanaconda/ui/tui/hubs/progress.py
@@ -24,7 +24,7 @@ import sys
from pyanaconda.flags import flags
from pyanaconda.i18n import _
-from pyanaconda.constants import THREAD_INSTALL, THREAD_CONFIGURATION
+from pyanaconda.constants import THREAD_INSTALL, THREAD_CONFIGURATION, eulaLocation
from pykickstart.constants import KS_SHUTDOWN, KS_REBOOT
from pyanaconda.ui.tui.hubs import TUIHub
@@ -125,7 +125,7 @@ class ProgressHub(TUIHub):
return True
def prompt(self, args = None):
- return(_("\tInstallation complete. Press return to quit"))
+ return(_("\tUse of this product is subject to the license agreement found at %s\n\n\tInstallation complete. Press return to quit" % eulaLocation))
def input(self, args, key):
# There is nothing to do here, just raise to exit the hub
--
1.8.3.1
10 years, 6 months
[master/rhel7-branch] Timezones translations and sorting
by Vratislav Podzimek
These three patches introduce timezones translations and sorting that should
match users expectations. One more patch is needed for the text mode, that one
will follow later.
Vratislav Podzimek (3):
Translate timezones in GUI
Set locale for our process
Provide our own sorting functions for regions and timezones
(#1025029)
anaconda.spec.in | 2 +-
pyanaconda/localization.py | 26 ++++++++++
pyanaconda/ui/gui/spokes/datetime_spoke.glade | 37 ++++++++------
pyanaconda/ui/gui/spokes/datetime_spoke.py | 72 +++++++++++++++++++++++++--
4 files changed, 116 insertions(+), 21 deletions(-)
--
1.7.11.7
10 years, 6 months
Make the timezone clicks make sense and other cleanups
by David Shea
You know how on the timezone map when you click somewhere around Kansas or
Missouri or so in Central time, you either end up with Denver in Mountain time
or Indiana/Vincennes in Eastern time? Or how if you click in northern Sweden,
in CET, you get Mariehamn, in EET? We have big, clear lines showing time zones,
so it's kind of annoying when you click a time zone and get another time zone.
The fourth patch in this set fixes that, and the previous three clean up some
minor things along the way. I guess it's a matter of opinion whether the first
one actually cleans anything up, but I thought that using floating point
arithmetic for calculating an undisplayed string that we control was kind of
super gross.
10 years, 6 months
[rhel7] Avoid raising an exception if epdb module unavailable (#1026779)
by Anne Mulhern
Resolves: rhbz#1026779
Catch the exception and print an informative log message if the import fails.
The startDebugging method is a convenience for developers, and this seemed
to be the most useful approach for those I talked to.
With this approach, if the developer wants
to load epdb into their updates.img file they can still use the HUP signal
functionality without further edits.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
anaconda | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/anaconda b/anaconda
index ce37365..fd9c507 100755
--- a/anaconda
+++ b/anaconda
@@ -414,8 +414,11 @@ def check_memory(anaconda, opts, display_mode=None):
time.sleep(2)
def startDebugger(signum, frame):
- import epdb
- epdb.serve(skip=1)
+ try:
+ import epdb
+ epdb.serve(skip=1)
+ except ImportError:
+ log.info("Failed to start epdb remote debugging; epdb module import failed")
def setupDisplay(anaconda, opts, addon_paths=None):
from pyanaconda.ui.tui.simpleline import App
--
1.8.3.1
10 years, 6 months
[master] Make dialog return code checking more robust
by Anne Mulhern
A dialog can return not only the values associated with its buttons but also
some other values. The value that it can certainly return is -4. This value
is most likely to occur when the user presses the escape key, and causes
the dialog to be deleted.
In some cases this possibility is not allowed for and the wrong action is
taken when the escape key is pressed because the code puts the unexpected
value in an equivalence class with some button that actually causes an
action to be taken.
The *.py files in pyanaconda were searched for occurances of the regular
expression =.*run and nearby lines were scrutinized and corrected if
necessary.
In general, the changes make an if condition more restrictive if the then
branch causes an action and less restrictive if it does not.
The changes to summary.glade from a previous commit
are reversed and custom.py
is updated appropriately as using the ResponseType constants would
be inconsistant with the rest of the code.
Related: rhbz#998384
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
pyanaconda/ui/gui/spokes/custom.py | 10 +++++-----
pyanaconda/ui/gui/spokes/lib/summary.glade | 4 ++--
pyanaconda/ui/gui/spokes/software.py | 2 ++
pyanaconda/ui/gui/spokes/source.py | 2 +-
pyanaconda/ui/gui/spokes/storage.py | 4 +++-
pyanaconda/ui/gui/spokes/welcome.py | 4 ++--
6 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 7d4e025..a81c72c 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1869,7 +1869,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
dialog.refresh(self.__storage.devicetree.findActions())
rc = dialog.run()
- if rc != int(Gtk.ResponseType.ACCEPT):
+ if rc != 1:
# Cancel. Stay on the custom screen.
return
@@ -1882,7 +1882,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
with enlightbox(self.window, dialog.window):
rc = dialog.run()
- if rc == 0:
+ if rc != 1:
# Cancel. Leave the old passphrase set if there was one.
return
@@ -2158,7 +2158,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
device.name, root_name)
rc = dialog.run()
- if rc == 0:
+ if rc != 1:
dialog.window.destroy()
return
@@ -2211,7 +2211,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
with enlightbox(self.window, dialog.window):
rc = dialog.run()
- if rc == 0:
+ if rc != 1:
return
disks = dialog.selected
@@ -2260,7 +2260,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
rc = dialog.run()
dialog.window.destroy()
- if rc == 0:
+ if rc != 1:
return
disks = dialog.selected
diff --git a/pyanaconda/ui/gui/spokes/lib/summary.glade b/pyanaconda/ui/gui/spokes/lib/summary.glade
index aba4914..3d020e8 100644
--- a/pyanaconda/ui/gui/spokes/lib/summary.glade
+++ b/pyanaconda/ui/gui/spokes/lib/summary.glade
@@ -197,8 +197,8 @@
</object>
</child>
<action-widgets>
- <action-widget response="-6">summaryCancelButton</action-widget>
- <action-widget response="-3">summaryAcceptButton</action-widget>
+ <action-widget response="0">summaryCancelButton</action-widget>
+ <action-widget response="1">summaryAcceptButton</action-widget>
</action-widgets>
</object>
</interface>
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 6291fea..9ae146f 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -426,3 +426,5 @@ class SoftwareSelectionSpoke(NormalSpoke):
# Send the user to the installation source spoke.
self.skipTo = "SourceSpoke"
self.window.emit("button-clicked")
+ else:
+ pass
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index f9b5658..f71c80b 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -237,7 +237,7 @@ class IsoChooser(GUIObject):
# If any directory was chosen, return that. Otherwise, return None.
rc = self.window.run()
- if rc:
+ if rc == 1:
f = self._chooser.get_filename()
if f:
retval = f.replace(constants.ISO_DIR, "")
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index fc5a7aa..6c5372c 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -755,7 +755,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
dialog = PassphraseDialog(self.data)
rc = self.run_lightbox_dialog(dialog)
- if rc == 0:
+ if rc != 1:
return False
self.passphrase = dialog.passphrase
@@ -875,6 +875,8 @@ class StorageSpoke(NormalSpoke, StorageChecker):
self.encrypted = dialog.encrypted
self.skipTo = "CustomPartitioningSpoke"
+ else:
+ return
self.applyOnSkip = True
NormalSpoke.on_back_clicked(self, button)
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
index 45abe88..86296aa 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -268,7 +268,7 @@ class WelcomeLanguageSpoke(LangLocaleHandler, StandaloneSpoke):
with enlightbox(self.window, dlg):
rc = dlg.run()
dlg.destroy()
- if rc == 0:
+ if rc != 1:
sys.exit(0)
if productName.startswith("Red Hat Enterprise Linux") and \
@@ -277,7 +277,7 @@ class WelcomeLanguageSpoke(LangLocaleHandler, StandaloneSpoke):
with enlightbox(self.window, dlg):
rc = dlg.run()
dlg.destroy()
- if rc == 0:
+ if rc != 1:
sys.exit(0)
StandaloneSpoke._on_continue_clicked(self, cb)
--
1.8.3.1
10 years, 6 months
[rhel7-branch] Display a EULA-related warning on TUI progress hub at end of installation. (#909309)
by Samantha N. Bueno
Related: rhbz#909309
---
pyanaconda/ui/tui/hubs/progress.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/tui/hubs/progress.py b/pyanaconda/ui/tui/hubs/progress.py
index 90d5731..a3e0b82 100644
--- a/pyanaconda/ui/tui/hubs/progress.py
+++ b/pyanaconda/ui/tui/hubs/progress.py
@@ -125,7 +125,7 @@ class ProgressHub(TUIHub):
return True
def prompt(self, args = None):
- return(_("\tInstallation complete. Press return to quit"))
+ return(_("\tUse of this product is subject to the license agreement found at /usr/share/doc/redhat-release/EULA\n\n\tInstallation complete. Press return to quit"))
def input(self, args, key):
# There is nothing to do here, just raise to exit the hub
--
1.8.3.1
10 years, 6 months