Description of problem ====================== Someone thought it would be a good idea to mute warnings from getopt in some parts of beakerlib: rlMount, rlHash, rlFileSubmit and rlRun. It makes debugging of strange problems even stranger, so it is not so good idea. Version-Release number of selected component ============================================ beakerlib-1.10-2.el6eso How reproducible ================ Always Steps to Reproduce ================== 1. Call one of mentioned functions with an unsupported option, e.g.: rlFileSubmit /etc/postfix/main.cf -etc-postfix-main.cf 2. Run the test 3. Observe the log 4. Scratch your head 5. Understand what's wrong or repeat steps 2-4 until your head skin hurts Actual results ============== Your head skin hurts. Expected results ================ Your head skin should not hurt. You should be able to understand that what you called there is an unsupported option. Additional info =============== The mentioned example is equivalent to something like: rlFileSubmit -e -t -c -- -p - o -s tfix-main.cf /etc/postfix/main.cf which is not what you wanted. (In this case, the code further falls flat on its face anyway due to bug 1295962 but that's another story.) Note that what gets called in rlFileSubmit is: $ getopt -q -o s: -- /etc/postfix/main.cf -etc-postfix-main.cf -s 'tfix-main.cf' -- '/foo/bar' $ Compare: $ getopt -o s: -- /etc/postfix/main.cf -etc-postfix-main.cf getopt: invalid option -- 'e' getopt: invalid option -- 't' getopt: invalid option -- 'c' getopt: invalid option -- '-' getopt: invalid option -- 'p' getopt: invalid option -- 'o' -s 'tfix-main.cf' -- '/foo/bar' $
Created attachment 1111964 [details] suggested patch
I don't think it is good idea add some unexpected output of command. May be it may make sense with DEBUG flag enabled or so. In other way it is just change behavior which may break compatibility.
I agree that unexpected output can break things on the other hand we should report that an error happened. For this reason we have rlLogError function. I would rather handle this situation internally with error message logged and proper (documented) return code. Would this solution be acceptable for you?
stderr is made for errors so I don't see why anything sould break by using it for its intended usage. Printing errors in obviously errorneous state is nothing "unexpected"; it's hiding them that is unexpected. Adding rlLogError and returning properly is not a bad idea but I guess there's ton of things in beakerlib that need such changes so it seems like a longer task. IMO this is nasty bug so I'd vote for just disabling the `-q` as hotfix (which I guess you will do anyway.) Hopefully I answered your question.
Yes solution would include removing '-q' but I think it would be good to handle it better that just let it go to stderr without any header or tag.
+1 to providing some feedback that an unsupported option has been used -1 to usign rlLog* functions - those are IMO for the user to log & report stuff, not for internal beakerlib usage. I vote for a simple stderr message & a non-zero return code
(In reply to Ales Zelinka from comment #8) > +1 to providing some feedback that an unsupported option has been used > -1 to usign rlLog* functions - those are IMO for the user to log & report > stuff, not for internal beakerlib usage. > > I vote for a simple stderr message & a non-zero return code I agree.
This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '23'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 23 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
still present in f24
This message is a reminder that Fedora 24 is nearing its end of life. Approximately 2 (two) weeks from now Fedora will stop maintaining and issuing updates for Fedora 24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '24'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 24 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle. Changing version to '27'.
This message is a reminder that Fedora 27 is nearing its end of life. On 2018-Nov-30 Fedora will stop maintaining and issuing updates for Fedora 27. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '27'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 27 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
Bit me again today. I stared baffled for hours why rlFileSubmit is just totally ignored, not even beep. Well the name started with `-var-...`
fixed by https://github.com/beakerlib/beakerlib/commit/dbaa50c025dbfc3d8574e57ddbfa8e4cbf1b89d5