Bug 1165265

Summary: log messages starting with '-' are mistaken for an option and not logged
Product: [Fedora] Fedora Reporter: Ales Zelinka <azelinka>
Component: beakerlibAssignee: Dalibor Pospíšil <dapospis>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: rawhideCC: dapospis, mfranc, pmuller, psplicha
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: beakerlib-1.10-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-12 14:48:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1136360, 1136362    

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.