Bug 824777 - rhnpush fails with NameError: global name 'h' is not defined
Summary: rhnpush fails with NameError: global name 'h' is not defined
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 550
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Pazdziora
QA Contact: Dimitar Yordanov
URL:
Whiteboard:
Depends On:
Blocks: sat550-blockers 855837
TreeView+ depends on / blocked
 
Reported: 2012-05-24 08:59 UTC by Jan Pazdziora
Modified: 2012-10-15 09:06 UTC (History)
4 users (show)

Fixed In Version: rhnpush-5.5.42-3
Doc Type: Bug Fix
Doc Text:
Clone Of: 823491
Environment:
Last Closed: 2012-10-15 09:06:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:1368 0 normal SHIPPED_LIVE Red Hat Network Tools rhnpush bug fix update 2012-10-15 13:05:08 UTC

Description Jan Pazdziora 2012-05-24 08:59:19 UTC
+++ This bug was initially created as a clone of Bug #823491 +++

Description of problem:
rhnpush fails with a global name h not defined error - line 506 of /usr/share/rhn/rhnpush/uploadLib.py

Version-Release number of selected component (if applicable):
spacewalk 1.7 
rhnpush-5.5.42-1.el6.noarch

How reproducible:
Everytime

Steps to Reproduce:
1. Obtain RPM from somewhere
2. rhnpush to the spacewalk server
3. observe error
  
Actual results:
Get the error: global name h not defined 

Expected results:
RPM package uploaded

Additional info:
I could have sworn this worked a couple of weeks ago - but I may be imagining it....

Locally editing /usr/share/rhn/rhnpush/uploadLib.py seems then to allow stuff to work (the channel page still has arch so I assume this change works...) - patch attached.

Comment 1 Jan Pazdziora 2012-05-24 09:00:08 UTC
The issue is caused by 4ed2374ccbc7f7dedb8fe6eaf7322700f06a4ca7 when the

h = get_header(None, f.fileno(), source)

was replaced with

a_pkg = package_from_filename(filename)

I assume the proper fix is

diff --git a/client/tools/rhnpush/uploadLib.py b/client/tools/rhnpush/uploadLib.py
index 2d0ed35..aae1604 100644
--- a/client/tools/rhnpush/uploadLib.py
+++ b/client/tools/rhnpush/uploadLib.py
@@ -503,7 +503,7 @@ class UploadClass:
         if source:
             lh.append('src')
         else:
-            lh.append(h['arch'])
+            lh.append(a_pkg.header['arch'])
 
         # Build the header hash to be sent
         hash = { 'header' : Binary(a_pkg.header.unload()),

Fixed in Spacewalk master, 03a1c48d59401856b2ffb4b2a96c4d51375b2cf4.

Comment 4 Dimitar Yordanov 2012-06-04 08:45:45 UTC
Verified.

Comment 9 errata-xmlrpc 2012-10-15 09:06:43 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-1368.html


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