Bug 1295963 - Do not mute warnings in getopt(1)
Summary: Do not mute warnings in getopt(1)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: 27
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: Dalibor Pospíšil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-05 22:45 UTC by Alois Mahdal
Modified: 2019-06-03 15:48 UTC (History)
6 users (show)

Fixed In Version: beakerlib-1.18-4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-03 15:48:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
suggested patch (1.79 KB, patch)
2016-01-05 22:54 UTC, Alois Mahdal
no flags Details | Diff

Description Alois Mahdal 2016-01-05 22:45:39 UTC
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'
    $

Comment 1 Alois Mahdal 2016-01-05 22:54:55 UTC
Created attachment 1111964 [details]
suggested patch

Comment 2 Jakub Prokes 2016-01-12 17:06:15 UTC
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.

Comment 3 Dalibor Pospíšil 2016-01-12 17:18:19 UTC
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?

Comment 4 Alois Mahdal 2016-01-12 18:00:56 UTC
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.

Comment 5 Dalibor Pospíšil 2016-01-13 10:05:14 UTC
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.

Comment 8 Ales Zelinka 2016-01-19 19:38:05 UTC
+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

Comment 9 Martin Kyral 2016-01-20 09:07:07 UTC
(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.

Comment 11 Fedora End Of Life 2016-11-24 14:43:56 UTC
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.

Comment 12 Alois Mahdal 2016-11-24 23:00:27 UTC
still present in f24

Comment 13 Fedora End Of Life 2017-07-25 19:43:38 UTC
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.

Comment 14 Jan Kurik 2017-08-15 06:59:50 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 15 Ben Cotton 2018-11-27 17:18:27 UTC
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.

Comment 16 Ben Cotton 2018-11-30 19:29:16 UTC
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.

Comment 17 Alois Mahdal 2019-04-27 19:06:33 UTC
Bit me again today.

I stared baffled for hours why rlFileSubmit is just totally ignored, not even beep.  Well the name started with `-var-...`


Note You need to log in before you can comment on or make changes to this bug.