Bug 741158

Summary: [virt-manager]Show VM description in a tooltip does not work with special character & <>
Product: Red Hat Enterprise Linux 6 Reporter: Daisy Wu <jwu>
Component: python-virtinstAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: gkong, jwu, mzhan, rwu, yupzhang, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 12:38:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daisy Wu 2011-09-26 05:29:24 UTC
Description of problem:
when input the special character & in the VM description input box and click "Apply" button, error pop up:Error changing VM configuration: 'NoneType' object is not callable.
when input the special character <> in the VM description input box and click "Apply" button, the tooltip display blank when mouse over the guest.

Version-Release number of selected component (if applicable):
virt-manager-0.9.0-6.el6
libvirt-0.9.4-12.el6
python-virtinst-0.600.0-3.el6

# uname -a
Linux wjw.nay.redhat.com 2.6.32-197.el6.x86_64 #1 SMP Tue Sep 13 12:26:24 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

How reproducible:
always

Steps to Reproduce:
1. Make sure have an existing guest in your host.
2. Launch virt-manager, select the existing guest,Divert to guest details page.
3. Input the special character & in the VM description input box and click "Apply" button,error pop up:Error changing VM configuration: 'NoneType' object is not callable.
2011-09-23 00:43:50,184 (error:80): dialog message: Error changing VM configurat
ion: 'NoneType' object is not callable : Error changing VM configuration: 'NoneType' object is not callable

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/details.py", line 2317, in _change_config_helper
    func(*args)
  File "/usr/share/virt-manager/virtManager/domain.py", line 517, in define_description
    return self._redefine_guest(change)
  File "/usr/share/virt-manager/virtManager/domain.py", line 301, in _redefine_guest
    return cb(guest)
  File "/usr/share/virt-manager/virtManager/domain.py", line 516, in change
    guest.description = newvalue or None
  File "/usr/lib/python2.6/site-packages/virtinst/XMLBuilderDomain.py", line 326, in new_setter
    for node, val, usexpath in node_map:
TypeError: 'NoneType' object is not callable

4. Input the special character <> in the VM description input box and click "Apply" button,the tooltip display blank when mouse over the guest.
  
  
Actual results:
As above.

Expected results:
Tooltip of vm description should be displayed correctly or pop up an error message to inform if the special character are not accepted.

Additional info:

Comment 2 Cole Robinson 2011-09-27 15:54:29 UTC
Not a huge priority so deferring to 6.3

Comment 4 Cole Robinson 2012-01-25 22:03:09 UTC
Moving to POST. Note to self: that commit introduced a regression causing us to fetch XML on every tick, need this change as well;

http://git.fedorahosted.org/git/?p=virt-manager.git;a=commit;h=79447707ace9dc75ad1ef2f86ce1106acccae1f5

Comment 5 Cole Robinson 2012-02-01 20:03:40 UTC
Fixed in virt-manager-0.9.0-8.el6

Comment 7 zhe peng 2012-02-10 05:57:04 UTC
test this with:
virt-manager-0.9.0-9.el6
python-virtinst-0.600.0-7.el6

step:
1. Make sure have an existing guest in your host.
2. Launch virt-manager, select the existing guest,Divert to guest details page.
3. Input the special character & in the VM description input box and click
"Apply" button,error pop up:Error changing VM configuration: 'NoneType' object
is not callable.
the error message same with bug description
the bug not fixed,move to assigned

Comment 8 Cole Robinson 2012-02-13 15:50:10 UTC
Hmm, indeed. I only fixed the issue of setting manager window tooltip with guests that have a description with reserved chars.

Proper fix for this in virtinst upstream:

http://git.fedorahosted.org/git?p=python-virtinst.git;a=commit;h=7442fbca3b394e8ba9e1e54d97d712146aa680f8

Comment 11 Cole Robinson 2012-04-02 22:25:38 UTC
Missed the alpha compose, but I'm doing a build shortly.

Comment 12 Cole Robinson 2012-04-02 22:38:32 UTC
Fixed in python-virtinst-0.600.0-8.el6

Comment 13 Geyang Kong 2012-04-05 07:09:32 UTC
Verified pass with the packages:

python-virtinst-0.600.0-8.el6
virt-manager-0.9.0-11.el6

Test steps:

1. Create a guest.

2. Click "show virtual hardware details".

3. Click Overview and input "&" in description.

4. Click apply and check tip when mouse over the guest.

5. Repeat step 3 and 4 but input "<>" instead.

Test results:

1. Description can be displayed normally when it contains "&" and "<>".

And change this bug to VERIFIED

Comment 14 Cole Robinson 2012-06-12 15:38:15 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No documentation needed.

Comment 16 errata-xmlrpc 2012-06-20 12:38:58 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.

http://rhn.redhat.com/errata/RHBA-2012-0785.html