Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not crash if RDP is selected after regular GUI startup failed (#2326410) #5999

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pyanaconda/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@ def on_mutter_ready(observer):
"an RDP session to connect to this computer from another computer and "
"perform a graphical installation or continue with a text mode "
"installation?")
rdp_creds = ask_rd_question(anaconda, message)
# we aren't really interested in the use_rd flag so at least mark it like this
# to avoid linters being grumpy
_use_rd, rdp_creds = ask_rd_question(anaconda, message)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly to me this doesn't seem correct.

I don't think we should set the flag.use_rd, it looks to me like a side effect. Another option is to not return the value but that would be less preferable to me as the side effect is still there.

In other words, from looking on this change set it doesn't sense why we ignore this value when we ask for it on line below, however, it's not visible that the use_rd flag is set inside the ask_rd_question.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather rewrite the calls in this method to something like:

def set_gui_mode_on_rdp(anaconda, use_rd):
        if not anaconda.gui_mode:
            log.info("RDP requested via RDP question, switching Anaconda to GUI mode.")
        anaconda.display_mode = constants.DisplayModes.GUI
        flags.use_rd = True

use_rd, rdp_creds = ask_rd_question(message)
set_gui_mode_on_rdp(anaconda, use_rd)

Seems cleaner to me.


# if they want us to use RDP do that now
if anaconda.gui_mode and flags.use_rd:
Expand Down
Loading