Bug 1391913

Summary: virt-who ignores -c option
Product: Red Hat Enterprise Linux 7 Reporter: Peter Tselios <tselios.petros>
Component: virt-whoAssignee: Chris Snyder <csnyder>
Status: CLOSED DUPLICATE QA Contact: Eko <hsun>
Severity: high Docs Contact:
Priority: medium    
Version: 7.4CC: bbuckingham, csnyder, hsun, jcallaha, ktordeur, sgao, tomckay, yuefliu
Target Milestone: pre-dev-freezeKeywords: 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-06-05 08:08: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:

Description Peter Tselios 2016-11-04 11:15:43 UTC
Description of problem:
2 latest version of virt-who ignore the -c option when run in -o mode. 

Version-Release number of selected component (if applicable):
0.17.9,
0.17.10

How reproducible:
Every time we run virt-who -o -c /etc/virt-who.d/<file> 

Create 2 configuration files under /etc/virt-who.d/ (eg loc1.conf and loc2.conf) 


Steps to Reproduce:
1. Create a configuration file /etc/virt-who.d/loc1.conf
2. Create a second configuration file /etc/virt-who.d/loc2.conf
3. Use ESX mode for both sites
4. Execute virt-who -o -c /etc/virt-who.d/loc1.conf

Actual results:
virt-who **ingores** the -c option and process ALL files under /etc/virt-who.d directory

Expected results:
virt-who should process only the configuration file we set. 

Additional info:
In version 0.14.9 works as expected. 

Severity is set to high because it can cause issues with subscriptions when ESXi hosts are added in the Satellite.

Comment 2 Eko 2017-03-28 08:15:10 UTC
now virt-who will run all the configure files in /etc/virt-who.d/ by default,
if the file is in /etc/virt-who.d/, with -c or without -c, this file will always be run,
the -c option often be used for the files not in /etc/virt-who.d/,

Hi Chris, do you think this is a bug?

Comment 4 Chris Snyder 2017-05-11 20:06:53 UTC
Considering this worked differently in prior versions of virt-who, I would say that this is a bug.

The current behaviour seems to be to add the configuration specified using -c but not to limit the configs used to only those specified using the cli options.

Is the desired behaviour to ignore all configuration in the /etc/virt-who.d directory if given at least one -c option?

Comment 6 Peter Tselios 2017-05-16 09:47:10 UTC
Hello,
Even if -c was designed to use files outside of /etc/virt-who.d, it's not documented. And in any case, we need to have a way to run virt-who for only one configuration file. 
It's not a option to remove unwanted files from /etc/virt-who.d, run the command and then place the rest of the files back in /etc/virt-who.d.

Comment 8 Liushihui 2017-11-09 05:49:03 UTC
It still exist on virt-who-0.21.0-1.el7.noarch

Comment 9 Kenny Tordeurs 2018-06-05 08:08:51 UTC
I would say this looks like a duplicate of [0] which has a better status report

[0] https://bugzilla.redhat.com/show_bug.cgi?id=1542652

*** This bug has been marked as a duplicate of bug 1542652 ***