Bug 1372165 - virt-who generate "AttributeError:" during register a rhel host to rhevm4.0
Summary: virt-who generate "AttributeError:" during register a rhel host to rhevm4.0
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who
Version: 7.3
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Chris Snyder
QA Contact: Eko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-01 05:47 UTC by Liushihui
Modified: 2019-10-28 07:20 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-23 03:26:14 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Liushihui 2016-09-01 05:47:12 UTC
Description of problem:
During the process of registering rhel host to rhevm4.0, virt-who will show "AttributeError: 'NoneType' object has no attribute 'text'" when virt-who run at rhevm mode

Version-Release number of selected component (if applicable):
virt-who-0.17-10.el7.noarch
subscription-manager-1.17.10-1.el7.x86_64
python-rhsm-1.17.6-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Register system to Satellite

2.Configure virt-who run at rhevm mode and restart virt-who service
[root@hp-z220-05 virt-who.d]# vim /etc/sysconfig/virt-who
VIRTWHO_BACKGROUND=1
VIRTWHO_DEBUG=1
[root@hp-z220-05 virt-who.d]# cat rhevm
[test-rhevm1]
type=rhevm
server=https://tyan-gt24-04.rhts.eng.bos.redhat.com:443/ovirt-engine/
username=admin@internal
password=red2015
owner=ACME_Corporation
env=Library

3. In rhevm webUI, add a rhel host to rhevm, check virt-who's log.
[root@hp-z220-05 virt-who.d]# tail -f /var/log/rhsm/rhsm.log
2016-09-01 01:43:17,688 [virtwho.test-rhevm1 ERROR] RhevM-1(4255):MainThread @virt.py:run:379 - Virt backend 'test-rhevm1' fails with exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtwho/virt/virt.py", line 372, in run
    self._run()
  File "/usr/lib/python2.7/site-packages/virtwho/virt/virt.py", line 409, in _run
    report = self._get_report()
  File "/usr/lib/python2.7/site-packages/virtwho/virt/virt.py", line 334, in _get_report
    return HostGuestAssociationReport(self.config, self.getHostGuestMapping())
  File "/usr/lib/python2.7/site-packages/virtwho/virt/rhevm/rhevm.py", line 155, in getHostGuestMapping
    sockets = host.find('cpu').find('topology').find('sockets').text
AttributeError: 'NoneType' object has no attribute 'text'
2016-09-01 01:43:17,688 [virtwho.test-rhevm1 INFO] RhevM-1(4255):MainThread @virt.py:run:392 - Waiting 60 seconds before retrying backend 'test-rhevm1'

Actual results:
It will show "AttributeError" every interval(60s) until registered to rhevm successfully

Expected results:
It shouldn't show any error info during register rhel hosts.

Additional info:

Comment 1 Chris Snyder 2016-12-22 16:45:44 UTC
The fix here should be to detect when a system is not registered and we are using a rhevm backend and output a better log message saying that the cause of the failure is a lack of registration.

Comment 2 Chris Snyder 2017-05-12 18:21:24 UTC
Where is there a rhevm instance to test against during development?

I would like to request the configuration used for reproduction of this bug.
The config given in comment 0 does not work for me today. (I wonder if the rhevm instance specified exists any longer?)


Thanks for your help!

Comment 3 Liushihui 2017-05-23 03:26:14 UTC
It hasn't reproduced on latest virt-who-0.19-4.el7.noarch. Therefore, close it. Thanks.


Note You need to log in before you can comment on or make changes to this bug.