Red Hat Bugzilla – Bug 497172
rhn_register doesn't show any error when wrong protocol specified in --serverUrl option
Last modified: 2016-07-03 20:54:14 EDT
Description of problem:
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. run this
The TUI quickly dissappears and no error message is showed.
There should be an error message in TUI or printed to stderr
The up2date log /var/log up2date shows this error:
[Wed Apr 22 12:20:38 2009] up2date File "/usr/sbin/rhn_register", line 1315, in ?
sys.exit(main() or 0)
File "/usr/sbin/rhn_register", line 742, in main
File "/usr/share/rhn/up2date_client/tui.py", line 996, in main
tui = Tui(screen)
File "/usr/share/rhn/up2date_client/tui.py", line 835, in __init__
Traceback is not user friendly.
if --serverUrl is not intereted for rhnreg_ks then
- up2date needs to print/log proper warning, not traceback
- needs to be documented (man page, info page, --help, -h, knowledge base, whateever applies).
Also, if the parametr is completely ignored then up2date should bail out while parsing parameters with invalid parameter usage error.
Since this is not a regression suggesting to fix in 4.9.
We cannot change the behaviour of rhn_register (up2date) for RHEL 4.9 to ignore the --serverUrl parameter because customers might have scripts that depend on that (incorrect maybe) behaviour and 4.9 is not the release to change the behaviour.
If the incorrect protocol is specified in /etc/sysconfig/rhn/up2date, it has the same ill effect as the --serverUrl on the command line. So we might want to focus on this bad behaviour.
The problem is that there actually is a handling of the incorrect protocol. However, the exception itself is not defined in up2dateErrors, so the exception actually is
'module' object has no attribute 'InvalidProtocolError'
And that does not get caught.
Transmitting file data .
Committed revision 194720.
qa: try more wrong scenarios like:
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
The rhn_register utility has been updated to display an appropriate error message when the "serverURL" option is supplied with an invalid protocol.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.