Bug 1557296

Summary: virt-who does not ignore commented out lines that are prefixed with tab space
Product: Red Hat Enterprise Linux 7 Reporter: Kenny Tordeurs <ktordeur>
Component: virt-whoAssignee: Nikos Moumoulidis <nmoumoul>
Status: CLOSED ERRATA QA Contact: Eko <hsun>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: khowell, nmoumoul, redakkan, rjerrido, wpoteat, yuefliu
Target Milestone: pre-dev-freezeKeywords: Triaged
Target Release: 7.7   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 12:40:51 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:

Description Kenny Tordeurs 2018-03-16 11:40:29 UTC
Description of problem:

When a line that is commented out is prefixed with a tab space the line is taken into account by virt-who

# cat esx.conf 
~~~~
[vcenter]
type=esx
server=vmware.sat6.example.redhat.com
username=administrator
password=xxxxx
owner=xxxxx
env=Library
	#filter_hosts=lab-esx-2.example.redhat.com
~~~

Looking at the output we can sse it's using the filter hosts:

# virt-who -od
~~~
2018-03-16 10:33:27,797 [rhsm.connection DEBUG] MainProcess(20950):MainThread @connection.py:_request:490 - Making request: POST /subscription/hypervisors/1979710?reporter_id=ktordeur-sat58.kenny.lan&cloaked=False&env=Library%0A%23filter_hosts%3Dlab-esx-2.example.redhat.com
~~~


Version-Release number of selected component (if applicable):
virt-who-0.18-6.el6_9.noarch

How reproducible:
100%

Steps to Reproduce:
1. virt-who conf with commented out line prefixed with tab space
2.
3.

Actual results:
Line is taken into account by virt-who

Expected results:
Line not taken into account by virt-who

Additional info:
Can be resolved by adding the # at the start of the line

~~~
[vcenter]
type=esx
server=vmware.sat6.gsslab.pnq.redhat.com
username=administrator
password=RedHat1!
owner=1979710
env=Library
#       #filter_hosts=lab-esx-2.gsslab.rdu2.redhat.com
~~~
~                                                                                                                                                                                                                  
~                                                                                                                                                                                                                  
~                                                                                                                                                                                                                  
~

Comment 2 Kevin Howell 2018-03-19 14:08:28 UTC
> env=Library
> 	#filter_hosts=lab-esx-2.example.redhat.com

Key point is that two lines are being treated as one key/value pair.

Comment 3 Kevin Howell 2018-03-19 14:14:13 UTC
*** Bug 1557868 has been marked as a duplicate of this bug. ***

Comment 4 Kevin Howell 2018-06-13 15:31:59 UTC
Dev: let's try to look for instances of the line feed (seen above as %0A), and warn if we detect this is any config values.

Comment 13 errata-xmlrpc 2019-08-06 12:40:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:2070