Bug 1140593

Summary: spacewalk-export-channels on RHEL5 fails with SyntaxError
Product: Red Hat Satellite 5 Reporter: Lukas Pramuk <lpramuk>
Component: OtherAssignee: Tomas Lestach <tlestach>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: medium    
Version: 560CC: chrobert, cperry, ggainey, mkollar, nerawat, tlestach, xdmoon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-utils-2.0.2-19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1141364 (view as bug list) Environment:
Last Closed: 2014-10-14 19:38:05 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1141364    

Description Lukas Pramuk 2014-09-11 10:06:47 UTC
Description of problem:
spacewalk-export-channels on RHEL5 fails with SyntaxError. 

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


How reproducible:
100%

Steps to Reproduce:
1.# spacewalk-export-channels
  File "/usr/bin/spacewalk-export-channels", line 195
    epoch = pkg['epoch'] if pkg['epoch'] is not None else '0'
                          ^
SyntaxError: invalid syntax


Actual results:
SyntaxError on python2.4

Expected results:
No SyntaxErrors

Additional info:
wrapped by spacewalk-export the error looks this way:

# spacewalk-export
INFO: Processing users...
INFO: Processing system-groups...
INFO: Processing config-files...
INFO: Processing repositories...
INFO: Processing channels...
  File "/usr/bin/spacewalk-export-channels", line 195
    epoch = pkg['epoch'] if pkg['epoch'] is not None else '0'
                          ^
SyntaxError: invalid syntax
INFO: Processing activation-keys...
INFO: Processing kickstart-scripts...
INFO: Processing system-profiles...
INFO: Export-file created at /root/spacewalk-export-dir/spacewalk_export.tar.gz

Comment 1 RHEL Program Management 2014-09-11 10:13:05 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Tomas Lestach 2014-09-11 10:28:48 UTC
spacewalk.git: acd203e067e7a886833be227a2006332a6a36dc0

Comment 6 Lukas Pramuk 2014-09-11 17:39:36 UTC
OOPS.

# rpm -q spacewalk-utils
spacewalk-utils-2.0.2-18.el5sat

# spacewalk-export-channels
Export directory has to be specified. Try --help:

usage: spacewalk-export-channels [options]

options:
  -d DIRECTORY, --dir=DIRECTORY
                        Export directory, required
  -e, --exported-only   CSV output will contain only exported packages (by
                        default, CVS output contains all packages, even those
                        available in external repositories and in clone
                        original channels)
  -f FORCE, --force=FORCE
                        Overwrite exported package rpms, even if already
                        present in the dump
  -o ORG_IDS, --org_id=ORG_IDS
                        Export only organization related channels specified by
                        its id
  -q, --quiet           Run quietly
  -s, --skip-repogeneration
                        Repodata generation will be omitted for exported
                        channels
  -S, --no-size         Don't check package size
  -v, --verbose         Increase verbosity
  -h, --help            show this help message and exit
Traceback (most recent call last):
  File "/usr/bin/spacewalk-export-channels", line 293, in ?
    exit(1)
TypeError: 'str' object is not callable

>>> sys.exit

Comment 7 Tomas Lestach 2014-09-12 15:07:53 UTC
It looks like Lukas already pushed a fix to ...
spacewalk.git: 4d49d7d2464b8a2194b437c3d163a3147e635c61

Comment 9 Lukas Pramuk 2014-09-12 22:02:49 UTC
VERIFIED. spacewalk-utils-2.0.2-19.el5sat

# spacewalk-export-channels
Export directory has to be specified. Try --help:

usage: spacewalk-export-channels [options]

options:
  -d DIRECTORY, --dir=DIRECTORY
                        Export directory, required
  -e, --exported-only   CSV output will contain only exported packages (by
                        default, CVS output contains all packages, even those
                        available in external repositories and in clone
                        original channels)
  -f FORCE, --force=FORCE
                        Overwrite exported package rpms, even if already
                        present in the dump
  -o ORG_IDS, --org_id=ORG_IDS
                        Export only organization related channels specified by
                        its id
  -q, --quiet           Run quietly
  -s, --skip-repogeneration
                        Repodata generation will be omitted for exported
                        channels
  -S, --no-size         Don't check package size
  -v, --verbose         Increase verbosity
  -h, --help            show this help message and exit


>>> no traceback on rhel5

Comment 11 errata-xmlrpc 2014-10-14 19:38:05 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-1632.html

Comment 12 Tomas Lestach 2014-10-24 14:01:28 UTC
*** Bug 1156266 has been marked as a duplicate of this bug. ***