-
Notifications
You must be signed in to change notification settings - Fork 356
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
base: master
Are you sure you want to change the base?
Do not crash if RDP is selected after regular GUI startup failed (#2326410) #5999
Conversation
…26410) The ask_rd_question() function returns not only the credentials tuple, but also the "use remote desktop" flag. We correctly handled that in the regular case where we ask for user password if user selected RDP instead of text mode. But we missed that in the harder to test case where RDP is suggested as an option to the user after regular locally running GUI startup fails. Oops! :P So handle the extra value and avoid the crash. :) Resolves: rhbz#2326410
6430ebd
to
5d4508f
Compare
/kickstart-test --testtype smoke |
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) |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good - yeah, it might actually make sense to set the flag there as well - its should still be marked as using RD even after Wayland crashed. Must have somehow mixed it all up with GUI/non-GUI mode. :)
Feel free to open a new PR & we can then close this one as obsolete. :)
@M4rtinK could you please tell me how to reproduce this situation? |
That's the tricky part - I think you need to crash your Wayland session, so that the GUI-startup-failed logic kicks in. :P On the other hand, I think you can just make |
The ask_rd_question() function returns not only the credentials tuple, but also the "use remote desktop" flag.
We correctly handled that in the regular case where we ask for user password if user selected RDP instead of text mode.
But we missed that in the harder to test case where RDP is suggested as an option to the user after regular locally running GUI startup fails. Oops! :P
So handle the extra value and avoid the crash. :)
Resolves: rhbz#2326410