Bug 525202

Summary: smoltSendProfile fails on EL5 due to urlparse
Product: [Fedora] Fedora EPEL Reporter: Chad Feller <cfeller>
Component: smoltAssignee: Mike McGrath <mmcgrath>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: el5CC: jeff, marius.stracna, mmcgrath, razvan.sandu
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.4-2.3.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-11-09 22:24:15 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
patch none

Description Chad Feller 2009-09-23 12:18:10 EDT
Created attachment 362326 [details]
patch

Description of problem:
smoltSendProfile throws traceback

Version-Release number of selected component (if applicable):
smolt-1.3.1-1.1.el5

How reproducible:
always 

Steps to Reproduce:
1. install smolt from EPEL
2. install python-ctypes (satisfy bug 525156)
3. run smoltSendProfile
  
Actual results:
Traceback (most recent call last):
  File "/usr/bin/smoltSendProfile", line 196, in ?
    proxies=proxies)
  File "/usr/share/smolt/client/smolt.py", line 588, in send
    self.write_pub_uuid(smoonURL,pub_uuid,pub_uuid_file)
  File "/usr/share/smolt/client/smolt.py", line 499, in write_pub_uuid
    pub_uuid_file += ("-"+smoonURLparsed.hostname)
AttributeError: 'tuple' object has no attribute 'hostname'

Expected results:
profile should be sent

Additional info:
This appears to be a Python 2.4 vs 2.6 issue.  urlparse behaves differently between python 2.4 and 2.6.  In 2.4 smoonURLparsed is a tuple, where in python 2.6 it is a urlparse.ParseResult.  According to (http://docs.python.org/library/urlparse.html) that is new in Python 2.5.

The quick and dirty hack might be to just replace:
        admin_token_file += ("-"+smoonURLparsed.hostname)
with
        admin_token_file += ("-"+smoonURLparsed[1])
for python 2.4 boxes such as EL5.

smoltSendProfile works after this change on my boxes.  

Attached is the patch for the above fix.
Comment 1 Răzvan Sandu 2009-10-07 19:20:40 EDT
Hello, 


I've hit this bug on about 100 CentOS machines, all running CentOS 5.3 with the most recent updates (as of October 8, 2009).

The message is:

Send this information to the Smolt server? (y/n) y
Traceback (most recent call last):
  File "/usr/bin/smoltSendProfile", line 196, in ?
    proxies=proxies)
  File "/usr/share/smolt/client/smolt.py", line 588, in send
    self.write_pub_uuid(smoonURL,pub_uuid,pub_uuid_file)
  File "/usr/share/smolt/client/smolt.py", line 499, in write_pub_uuid
    pub_uuid_file += ("-"+smoonURLparsed.hostname)
AttributeError: 'tuple' object has no attribute 'hostname'


Programs versions are:
smolt-1.3.1-1.1.el5
python-2.4.3-24.el5_3.6


Best regards,
Răzvan
Comment 2 Fedora Update System 2009-10-13 16:46:08 EDT
smolt-1.4-2.3.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/smolt-1.4-2.3.el5
Comment 3 Fedora Update System 2009-10-16 15:33:44 EDT
smolt-1.4-2.3.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update smolt'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/EL-5/FEDORA-EPEL-2009-0647
Comment 4 Chad Feller 2009-10-16 17:26:43 EDT
appears to be fixed in smolt-1.4-2.3.el5...
Comment 5 Fedora Update System 2009-11-09 22:24:04 EST
smolt-1.4-2.3.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.