Bug 459254

Summary: Cannot register guest on old host
Product: [Community] Spacewalk Reporter: Miroslav Suchý <msuchy>
Component: ServerAssignee: Miroslav Suchý <msuchy>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: low    
Version: 0.6CC: cperry, dgoodwin
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-17 07:00:06 UTC Type: ---
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: 456550    

Description Miroslav Suchý 2008-08-15 12:38:14 UTC
+++ This bug was initially created as a clone of Bug #246720 +++

Description of problem:
I have XEN host. It was registered to Satellite (4.9). Satellite was then
upgraded to 500 and when I try to register new guest running on thist host, I
got traceback.

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

How reproducible:
done twice

Steps to Reproduce:
1. take older satellite < 500
2. register XEN host to this satellite
3. upgrade satellite
4. register guest to this satellite
  
Actual results:
Traceback (see attachment)

Expected results:
register system

Additional info:
If I delete profile and reregister host, the guest is registered without problem.

--- Additional comment from msuchy on 2007-08-01 08:33:35 EDT ---

With this patch it works:

--- /usr/share/rhn/server/rhnVirtualization.py.orig     2007-08-01
14:14:45.000000000 +0200
+++ /usr/share/rhn/server/rhnVirtualization.py  2007-08-01 14:18:26.000000000 +0200
@@ -594,7 +594,7 @@
         new_values_array = []
         bindings = {}

-        if not existing_row['confirmed']:
+        if not existing_row.has_key('confirmed'):
             new_values_array.append('confirmed=1')

         if existing_row['host_system_id'] != host_id:


--- Additional comment from nstrug on 2008-07-04 10:36:02 EDT ---

note that the following syntax:

if not existing_row['confirmed']:

is used a few times, not just here. We should really check the code throughout
as this is a python coding error.

Should be:

if not existing_row.has_key('confirmed'):
-or-
if not existing_row.get('confirmed'):

Comment 1 Miroslav Suchý 2008-08-15 12:45:10 UTC
I searched code and find only one more line.
I put there:
if not existing_row.get('confirmed'):
as it is more readable.
commited as 1efca5bdb4f32993faa8e7e51231930dffd95c1f

Comment 2 Devan Goodwin 2008-09-05 16:43:53 UTC
[root@rlx-3-12 rhn]# grep -r existing_row * | grep confirmed

server/rhnVirtualization.py:        if not existing_row.get('confirmed'): 

server/rhnVirtualization.py:        if not existing_row.get('confirmed'): 

[root@rlx-3-12 rhn]# 


Cannot test this fully in spacewalk 0.2 as there is no upgrade path from Satellite 4.9. Regardless marking verified in spacewalk 0.2 based on code changes, verification of the original ticket this was cloned from will cover the rest.

Comment 3 Miroslav Suchý 2009-09-17 07:00:06 UTC
Spacewalk is released for long time.