Bug 1165265 - log messages starting with '-' are mistaken for an option and not logged
Summary: log messages starting with '-' are mistaken for an option and not logged
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: rawhide
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Dalibor Pospíšil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: Fedora-beakerlib-1.10 1136362
TreeView+ depends on / blocked
 
Reported: 2014-11-18 16:55 UTC by Ales Zelinka
Modified: 2014-12-12 14:51 UTC (History)
4 users (show)

Fixed In Version: beakerlib-1.10-1
Clone Of:
Environment:
Last Closed: 2014-12-12 14:48:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ales Zelinka 2014-11-18 16:55:50 UTC
. /usr/share/beakerlib/beakerlib.sh
[chuch ~]$ rlLog "hola hej"
:: [ 17:55:04 ] :: hola hej
BEAKERLIB_JOURNAL not defined in the environment
[chuch ~]1$ rlLog "-hola hej"
:: [ 17:55:10 ] :: 
BEAKERLIB_JOURNAL not defined in the environment

Comment 1 Dalibor Pospíšil 2014-11-18 20:00:00 UTC
As rlLog function has got a flag it uses standard parsing using getopt. I would say this is expected and can be workaround by '--', e.g. rlLog -- '-hola hej'.

May be documentation change would be good.

Comment 2 Ales Zelinka 2014-11-19 13:12:28 UTC
sorry but regressions should not need to be worked around. Why not fix it?

Comment 3 Miroslav Franc 2014-11-19 14:16:07 UTC
(In reply to Dalibor Pospíšil from comment #1)
> As rlLog function has got a flag it uses standard parsing using getopt. I
> would say this is expected and can be workaround by '--', e.g. rlLog --
> '-hola hej'.

While what you are saying is certainly true, we all wrote wayloads of our testcases long before option parsing was introduced into rlLog.  From this point of view, it is a regression.

Comment 4 Dalibor Pospíšil 2014-11-20 12:30:57 UTC
Ok, so the only solution I can think of is to treat the flag --prio-label as standard positioned argument (4th). I expect the flag is not used elsewhere so I can rewrite it completely.


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