Bug 1379161

Summary: HTTP proxy connection Error _set_hostport httplib - python 2.7
Product: [Community] Spacewalk Reporter: girolamo.piccinni
Component: ClientsAssignee: Michael Mráka <mmraka>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 2.5CC: mmraka
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-12 11:33:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description girolamo.piccinni 2016-09-25 14:21:09 UTC
Description of problem:

When using a HTTP proxy to connect from spacewalk client to spacewalk server I got an error stating that instance has no attribute '_set_hostport'.
This seems to be related to a python httplib change as the '_set_hostport' method has been removed.

The file on the client using this method is spacewalk/client/rhel/rhnlib/rhn/connections.py.


Version-Release number of selected component (if applicable):
Spacewalk client version RHEL 2.5 - python 2.7

How reproducible:
Set a HTTP proxy between your client and the spacewalk server.

Steps to Reproduce:
1. Setup the HTTP proxy 
2. Register the client using: rhnreg_ks --proxy http://myproxy:proxy_port/ 

Actual results:
Error in the log stating instance has no attribute '_set_hostport'.

Expected results:
Client correctly registered to the spacewalk server without connection errors.

Additional info:
I'm registering an AmazonLinux client to a spacewalk server. As AmazonLinux uses python2.7 I'm using spacewalk client from RHEL 7.

It would be sufficient to remove _set_hostport and replace the connection using _set_tunnel as follows:
con = httplib.HTTPConnection(proxyHost, proxyPort)
con.set_tunnel("spacewalkServer", spacewalkServerport)

I've modified rhel/rhnlib/rhn/connections.py on my client and the connection works.

Comment 1 Michael Mráka 2019-07-12 11:33:03 UTC
This issue seems to be same we fixed in bug 1652859.