Bug 1006861 - [ovirt-guest-agent] syntaxerror because of python 2.4.x on RHEL5 in /usr/share/ovirt-guest-agent/GuestAgentLinux2.py
Summary: [ovirt-guest-agent] syntaxerror because of python 2.4.x on RHEL5 in /usr/shar...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-guest-agent
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 3.3.0
Assignee: Martin Betak
QA Contact: Pavel Novotny
URL:
Whiteboard: virt
Depends On:
Blocks: 995464 995465
TreeView+ depends on / blocked
 
Reported: 2013-09-11 12:11 UTC by Jiri Belka
Modified: 2015-09-22 13:09 UTC (History)
7 users (show)

Fixed In Version: is18
Doc Type: Bug Fix
Doc Text:
A syntax error in /usr/share/ovirt-guest-agent/GuestAgentLinux2.py was caused by incompatibility with python 2.4, so the guest agent failed on Red Hat Enterprise Linux 5 guests. This error is fixed by rewriting the instances of ternary operator "if" to be compatible with python 2.4. The syntax error no longer occurs.
Clone Of:
Environment:
Last Closed: 2014-01-21 15:52:28 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0057 0 normal SHIPPED_LIVE rhevm-guest-agent bug fix update 2014-01-21 20:04:25 UTC
oVirt gerrit 19148 0 None None None Never

Description Jiri Belka 2013-09-11 12:11:15 UTC
Description of problem:

# /etc/init.d/ovirt-guest-agent start
Starting ovirt-guest-agent: Traceback (most recent call last):
  File "/usr/share/ovirt-guest-agent/ovirt-guest-agent.py", line 25, in ?
    from GuestAgentLinux2 import LinuxVdsAgent
  File "/usr/share/ovirt-guest-agent/GuestAgentLinux2.py", line 170
    param = '-r' if reboot else '-h'
                  ^
SyntaxError: invalid syntax
                                                           [FAILED]

# python
Python 2.4.3 (#1, Oct 23 2012, 22:02:41) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> param = '-r' if True else '-h'
  File "<stdin>", line 1
    param = '-r' if True else '-h'
                  ^
SyntaxError: invalid syntax

rhel6 comparison:

$ python
Python 2.6.6 (r266:84292, May 27 2013, 05:35:12) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> param = '-r' if True else '-h'
>>> param
'-r'


Version-Release number of selected component (if applicable):
is13

How reproducible:
100%

Steps to Reproduce:
1. start GA
2.
3.

Actual results:
FAILED because syntax error

Expected results:
happy running

Additional info:
be more conservative :)

Comment 2 Vinzenz Feenstra [evilissimo] 2013-10-01 08:21:43 UTC
Merged to u/s master branch: http://gerrit.ovirt.org/gitweb?p=ovirt-guest-agent.git;a=commit;h=7ceef1528359bea44aa2f705318bff1bbfb9d7a6

Comment 5 Pavel Novotny 2013-10-02 14:34:50 UTC
FailedQA in rhevm-guest-agent-1.0.8-4.el5ev (is17).

The problem still persists:

# rpm -q rhevm-guest-agent
rhevm-guest-agent-1.0.8-4.el5ev
# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.10 (Tikanga)
# /etc/init.d/ovirt-guest-agent start
Starting ovirt-guest-agent: Traceback (most recent call last):
  File "/usr/share/ovirt-guest-agent/ovirt-guest-agent.py", line 25, in ?
    from GuestAgentLinux2 import LinuxVdsAgent
  File "/usr/share/ovirt-guest-agent/GuestAgentLinux2.py", line 170
    param = '-r' if reboot else '-h'
                  ^
SyntaxError: invalid syntax
                                                           [FAILED]

Comment 6 Vinzenz Feenstra [evilissimo] 2013-10-02 14:46:34 UTC
Patch was in the build but was not applied -_-

Comment 7 Pavel Novotny 2013-10-16 16:19:37 UTC
Verified in rhevm-guest-agent-1.0.8-5.el5ev (is18).

[root@localhost ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.10 (Tikanga)
[root@localhost ~]# /etc/init.d/ovirt-guest-agent start
Starting ovirt-guest-agent:                                [  OK  ]

Comment 9 errata-xmlrpc 2014-01-21 15:52:28 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-2014-0057.html


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