Bug 1323029

Summary: virt-who will check .swp file in /etc/virt-who.d/
Product: Red Hat Enterprise Linux 6 Reporter: Eko <hsun>
Component: virt-whoAssignee: Chris Snyder <csnyder>
Status: CLOSED ERRATA QA Contact: gaoshang <sgao>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8CC: rbalakri, sgao, shihliu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.18-1.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 10:30:17 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 Eko 2016-04-01 03:37:25 UTC
Description of problem:
use vim to open a config file such as: vi /etc/virt-who.d/esx.conf, if don't quit vim, there is a ".esx.conf.swp" file created, virt-who will check the .swp file and feedback error message.
the expected result is: virt-who shouldn't check the .esx.conf.swp file.


Version-Release number of selected component (if applicable):
virt-who-0.16-7.el6.noarch
subscription-manager-1.16.8-8.el6.x86_64
python-rhsm-1.16.6-1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. use vim edit a config file:
# vim /etc/virt-who.d/esx.conf
[test-esx]
type=esx
server=10.73.2.95
username=Administrator
#password=Welcome1!
owner=ACME_Corporation
env=Library

2. save the file, but don't quit vim, make sure esx.conf.swp exist

3. restart virt-who and check rhsm.log
2016-04-01 11:33:12,662 [virtwho.init INFO] MainProcess(8794):MainThread @virtwho.py:parseOptions:637 - Using reporter_id='hp-z220-10.qe.lab.eng.nay.redhat.com'

================== ERROR Message ================
2016-04-01 11:33:12,665 [virtwho.init ERROR] MainProcess(8794):MainThread @config.py:__init__:341 - Configuration file .esx.conf.swp contains no section headers
=================================================

2016-04-01 11:33:12,665 [virtwho.init DEBUG] MainProcess(8794):MainThread @virtwho.py:__init__:125 - Using config named 'test-esx'
2016-04-01 11:33:12,665 [virtwho.init INFO] MainProcess(8794):MainThread @virtwho.py:main:729 - Using configuration "test-esx" ("esx" mode)
2016-04-01 11:33:12,683 [virtwho.main DEBUG] MainProcess(8796):MainThread @virtwho.py:run:231 - Starting infinite loop with 60 seconds interval
2016-04-01 11:33:12,811 [virtwho.test-esx DEBUG] Esx-1(8804):MainThread @virt.py:run:358 - Virt backend 'test-esx' started
2016-04-01 11:33:12,812 [virtwho.test-esx DEBUG] Esx-1(8804):MainThread @esx.py:_prepare:55 - Log into ESX
......

Actual results:
virt-who will read .esx.conf.swp file


Expected results:
virt-who shouldn't check .esx.conf.swp file


Additional info:

Comment 4 Radek Novacek 2016-10-13 08:17:03 UTC
Fixed in virt-who-0.18-1.el6.

Comment 6 Eko 2016-12-06 02:18:51 UTC
verified in virt-who-0.18-1.el6.noarch

Comment 8 errata-xmlrpc 2017-03-21 10:30:17 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://rhn.redhat.com/errata/RHBA-2017-0675.html