Bug 1309468 - UnboundLocalError: local variable 'primif' referenced before assignment
UnboundLocalError: local variable 'primif' referenced before assignment
Product: Spacewalk
Classification: Community
Component: Server (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tomáš Kašpárek
Red Hat Satellite QA List
Depends On:
Blocks: space27
  Show dependency treegraph
Reported: 2016-02-17 17:05 EST by W. Andrew Denton
Modified: 2017-09-28 14:11 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-06-16 03:52:43 EDT
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 W. Andrew Denton 2016-02-17 17:05:03 EST
Description of problem:
Registering a certain system causes 500 Internal Server error. This appears to be due to an interface on the client system that has no IP address.

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py", line 129, in call_function
    response = func(*params)
  File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 1030, in add_hw_profile
    if primif:
UnboundLocalError: local variable 'primif' referenced before assignment

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

How reproducible:

This change fixes the problem for me:

--- /usr/share/rhn/server/handlers/xmlrpc/registration.py.orig	2016-02-17 14:02:46.742891028 -0800
+++ /usr/share/rhn/server/handlers/xmlrpc/registration.py	2016-02-17 13:40:28.343527458 -0800
@@ -1011,6 +1011,7 @@
         if row:
+            primif = None
             if ipaddr:
                 h = rhnSQL.prepare("""
                     select interface_id from rhnServerNetAddress4 where address = :address
Comment 1 Tomáš Kašpárek 2016-03-10 07:57:58 EST
Comment 2 Tomáš Kašpárek 2016-06-16 03:52:43 EDT
Spacewalk 2.5 was released.
Comment 3 Eric Herget 2017-09-28 14:11:14 EDT
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.

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