Bug 1140593 - spacewalk-export-channels on RHEL5 fails with SyntaxError
Summary: spacewalk-export-channels on RHEL5 fails with SyntaxError
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Other
Version: 560
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Lukas Pramuk
URL:
Whiteboard:
: 1156266 (view as bug list)
Depends On:
Blocks: 1141364
TreeView+ depends on / blocked
 
Reported: 2014-09-11 10:06 UTC by Lukas Pramuk
Modified: 2018-12-09 18:33 UTC (History)
7 users (show)

Fixed In Version: spacewalk-utils-2.0.2-19
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1141364 (view as bug list)
Environment:
Last Closed: 2014-10-14 19:38:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1197893 0 None None None Never
Red Hat Product Errata RHBA-2014:1632 0 normal SHIPPED_LIVE Red Hat Satellite bug fix update 2014-10-14 23:37:20 UTC

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. ***


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