Bug 867862 - pcp - python inline if else statements
pcp - python inline if else statements
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: pcp (Show other bugs)
DTS 1.1 RHEL 5
All Linux
unspecified Severity unspecified
: ---
: 1.1
Assigned To: Nathan Scott
Depends On:
  Show dependency treegraph
Reported: 2012-10-18 08:55 EDT by Tomas Dohnalek
Modified: 2013-02-15 02:30 EST (History)
7 users (show)

See Also:
Fixed In Version: devtoolset-1.1-pcp-3.6.9-2.el[56]
Doc Type: Bug Fix
Doc Text:
Prior versions of pmcollectl used python syntax that was unsupported on RHEL5's python 2.4. This version uses an equivalent syntax supported by older python.
Story Points: ---
Clone Of:
Last Closed: 2013-01-22 10:36:01 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tomas Dohnalek 2012-10-18 08:55:29 EDT
Description of problem:
When running new upstream test-suite's test-cases 707 and 709 on RHEL5, I got errors similar to:

> SyntaxError: invalid syntax
>   File "/opt/rh/devtoolset-1.1/root/usr/bin/pmcollectl", line 78
>     return atom1.l - (atom2.l if not first else 0)
>                                ^
> SyntaxError: invalid syntax


> File "/opt/rh/devtoolset-1.1/root/var/lib/pcp/testsuite/src/test_pcp.python", line 37
>     print (" ") if (i > 0) else "", arr_p[i].contents
>                  ^
> SyntaxError: invalid syntax

I believe, that these inline statements are available in >= python-2.5, but there is only python-2.4 on RHEL5.

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

How reproducible:

Steps to Reproduce:
1. Run test-cases 707 or 709
Actual results:

Expected results:

Additional info:
Comment 2 Nathan Scott 2012-10-18 20:05:21 EDT
Have asked scox for his thoughts on how best to fix these.
Comment 3 Stan Cox 2012-10-19 16:51:15 EDT
sourceware pcpfans.git on scox/dev branch has commit 515b7bc5cf which splits this into if/then/else
Comment 4 Nathan Scott 2012-10-19 19:16:33 EDT
This is merged into upstream dev pcp tree, thanks Stan!  At this stage, the plan is to rollup all of these DTS fixes into a pcp-3.6.9-2 early next week.

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