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

bcl installerbot-noreply at redhat.com
Tue Sep 8 16:03:16 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 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/ui/tui/spokes/askvnc.py b/pyanaconda/ui/tui/spokes/askvnc.py
index f9e087e..62c1af9 100644
--- a/pyanaconda/ui/tui/spokes/askvnc.py
+++ b/pyanaconda/ui/tui/spokes/askvnc.py
@@ -105,7 +105,11 @@ 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 can_touch_runtime_system
+                if can_touch_runtime_system("reboot"):
+                    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/977db5ad180e3f8c8ed4d81dd509dbf26e4b948f


More information about the anaconda-patches mailing list