Bug 640626

Summary: Python error when trying to provision RHEL6
Product: Red Hat Satellite 5 Reporter: Alexander Todorov <atodorov>
Component: ProvisioningAssignee: Justin Sherrill <jsherril>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 540CC: bpeck, cperry, jhutar
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: 2010-10-06 14:28:58 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: 487677    

Description Alexander Todorov 2010-10-06 13:49:41 UTC
Description of problem:

I try to re-provision a RHEL6 system using a Satellite deployed by SysMgmt QE. The error on the client is:

[Wed Oct  6 09:41:55 2010] up2date D: do_call kickstart.initiate ('sat-blade-8.idm.lab.bos.redhat.com', 'spacewalk-koan', ' console=ttyS0,57600 ks=link ', '', 'rhel6-i386-sun-x8420-01.rhts.eng.bos.redhat.com:1', [])
[Wed Oct  6 09:41:55 2010] up2date initiating spacewalkkoan kickstart
[Wed Oct  6 09:41:57 2010] up2date D: Sending back response (1, 'Kickstart failed. Koan error.', {'koan': '  File "/usr/share/rhn/spacewalkkoan/spacewalkkoan.py", line 128, in initiate\n    k.run()\n   File "/usr/lib/python2.6/site-packages/koan/app.py", line 349, in run\n    self.replace()\n   File "/usr/lib/python2.6/site-packages/koan/app.py", line 910, in replace\n    return self.net_install(after_download)\n   File "/usr/lib/python2.6/site-packages/koan/app.py", line 586, in net_install\n    after_download(self, profile_data)\n   File "/usr/lib/python2.6/site-packages/koan/app.py", line 819, in after_download\n    (make, version, rest) = utils.os_release()\n   File "/usr/lib/python2.6/site-packages/koan/utils.py", line 358, in os_release\n    version = float(version[0])\n'})


Version-Release number of selected component (if applicable):
Satellite 5.4.0 (or more likely a nightly of it)
rhn-check-1.0.0-38.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. Register a RHEL6/Server/i386 system to latest Satellite. The Satellite has RHEL6 channels synced.
2. Create a kickstart profile (nothing fancy: @base pkg set, adjust kernel parameters for serial console, leave others at default settings).
3. Locate the system in the webUI and from the Provisioning tab select the ks profile and click Schedule kickstart and finish button
4. On the client run rhn_check -vv and observe the failure.
  
Actual results:
Failure

Expected results:
System is re-provisioned.

Additional info:
Together with Jan Hutar we've identified that packages in the RHEL6 RHN tools channel were not signed. The above error is when gpgcheck=0 in yum.conf and rhnplugin.conf

Comment 1 Jan Hutař 2010-10-06 13:55:30 UTC
Koan seems to not detect RHEL6 OS release correctly.

Traceback is:

invalid literal for float(): server
  File "/usr/share/rhn/spacewalkkoan/spacewalkkoan.py", line 128, in initiate
    k.run()
   File "/usr/lib/python2.6/site-packages/koan/app.py", line 349, in run
    self.replace()
   File "/usr/lib/python2.6/site-packages/koan/app.py", line 910, in replace
    return self.net_install(after_download)
   File "/usr/lib/python2.6/site-packages/koan/app.py", line 586, in net_install
    after_download(self, profile_data)
   File "/usr/lib/python2.6/site-packages/koan/app.py", line 819, in after_download
    (make, version, rest) = utils.os_release()
   File "/usr/lib/python2.6/site-packages/koan/utils.py", line 361, in os_release
    return (make, float(version), rest)

When this happens variables are set like this:

data = 'redhat-release-server-6server-6.0.0.37.el6.i686'
version = 'server'

When I have "fixed" using:

--- /usr/lib/python2.6/site-packages/koan/utils.py.ORIG	2010-10-06 09:45:09.431449325 -0400
+++ /usr/lib/python2.6/site-packages/koan/utils.py	2010-10-06 09:49:03.202323604 -0400
@@ -355,7 +355,10 @@
       try:
          version = float(version)
       except:
-         version = float(version[0])
+         print version
+         version = float(6)
+         #version = float(version[0])
+      print make, float(version), rest
       return (make, float(version), rest)
    elif check_dist() == "debian":
       fd = open("/etc/debian_version")

It produced:

server
redhat 6.0 6server

Comment 2 Clifford Perry 2010-10-06 14:03:13 UTC
Versoin of spacewalk-koan and koan being used? We pushed new stuff last week I think for this by Justin.

Comment 3 Alexander Todorov 2010-10-06 14:08:44 UTC
spacewalk-koan-0.2.7-1.el6sat.noarch
koan-2.1.0-2.git.87.6daccdd.el6.noarch

Comment 4 Justin Sherrill 2010-10-06 14:12:18 UTC
This should already be fixed in cobbler-2.0.3.1-11

Let me make sure it made it to the build.

Comment 7 Jan Hutař 2010-10-06 14:28:58 UTC

*** This bug has been marked as a duplicate of bug 637905 ***

Comment 9 Bill Peck 2010-10-07 13:24:00 UTC
is spacewalk-koan compatible with regular cobbler?  If so I'll switch our rhel6 repo to pull that instead.