[rhel7-branch 1/1] Quit in askvnc should not reboot image and dirinstall (#1255069)

bcl installerbot-noreply at redhat.com
Thu Sep 3 23:14:45 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

When running in --image or --dirinstallmode answering 'q' to the askvnc
question should not reboot the host machine, it should just exit. The
normal exithandler isn't setup yet, so check flags to decide whether
to reboot or exit(1).

Resolves: rhbz#1255069
---
 pyanaconda/ui/tui/spokes/askvnc.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/ui/tui/spokes/askvnc.py b/pyanaconda/ui/tui/spokes/askvnc.py
index f9e087e..f32f0e4 100644
--- a/pyanaconda/ui/tui/spokes/askvnc.py
+++ b/pyanaconda/ui/tui/spokes/askvnc.py
@@ -105,7 +105,12 @@ def input(self, args, key):
             d = YesNoDialog(self.app, _(self.app.quit_message))
             self.app.switch_screen_modal(d)
             if d.answer:
-                execWithRedirect("systemctl", ["--no-wall", "reboot"])
+                from pyanaconda.flags import flags
+                if not flags.imageInstall and not flags.livecdInstall \
+                   and not flags.dirInstall:
+                    execWithRedirect("systemctl", ["--no-wall", "reboot"])
+                else:
+                    sys.exit(1)
         else:
             return key
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/47435c05ae83cc2e150a32baba4121e08d9b2e6d


More information about the anaconda-patches mailing list