Bug 1542652

Summary: virt-who -c filename do not parse only the specified filename
Product: Red Hat Enterprise Linux 7 Reporter: Daniele Palumbo <daniele>
Component: virt-whoAssignee: Nikos Moumoulidis <nmoumoul>
Status: CLOSED ERRATA QA Contact: Eko <hsun>
Severity: low Docs Contact:
Priority: low    
Version: 7.4CC: aperotti, candlepin-bugs, csnyder, daniele, dconsoli, hshukla, jhnidek, khowell, ktordeur, nmoumoul, pmoravec, tselios.petros, wpoteat, yuefliu
Target Milestone: rcKeywords: EasyFix, Triaged
Target Release: ---   
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: 2018-10-30 10:47:49 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: 1353215    

Description Daniele Palumbo 2018-02-06 17:58:05 UTC
Description of problem:
virt-who -c help to specify a dedicated configuration file to be parsed.
Using -c option, all of the configuration specified in virt-who.conf and virt-who.d/* are parsed as well.


Version-Release number of selected component (if applicable):
RHEL 7.4, virt-who-0.19-7.el7_4.noarch

How reproducible:
Always

Steps to Reproduce:
1. write some virt-who entry in /etc/virt-who.conf file or in /etc/virt-who.d/*.conf file
2. run virt-who -c /otherpath/file

Actual results:
Currently virt-who will add all of the configuration from virt-who.conf and virt-who.d, plus the configuration from -c command line option

Expected results:
Only the -c file should be parsed.


Additional info:

From the man VIRT-WHO-CONFIG(5)                                                 
"""                         
  -c CONFIGS, --config=CONFIGS
                        Configuration file that will be processed, can be used
                        multiple times
"""
There is no mention to parsing (or not) of defaults files.

The problem should be likely addressed at 
https://github.com/virt-who/virt-who/blob/744a6c9f39b01a3a1a42f691ef3971f5ecc5fabd/virtwho/config.py#L1376
While for RHEL 7.4 should be in config.py, line 530
"""
        try:
            all_dir_content = set(os.listdir(config_dir))
"""

HTH

Comment 3 Kevin Howell 2018-02-08 15:32:27 UTC
Workaround is to rename/move config files temporarily. Recent versions of virt-who (virt-who-0.19-5 or newer) will ignore files whose names don't end in ".conf"...

Comment 7 Kenny Tordeurs 2018-06-05 08:08:51 UTC
*** Bug 1391913 has been marked as a duplicate of this bug. ***

Comment 11 Hradayesh Shukla 2018-10-02 21:55:40 UTC
*** Bug 1626243 has been marked as a duplicate of this bug. ***

Comment 13 errata-xmlrpc 2018-10-30 10:47:49 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-2018:3169