Bug 833390

Summary: subscription-manager release --list ignores command line proxy options
Product: Red Hat Enterprise Linux 6 Reporter: RHEL Program Management <pm-rhel>
Component: subscription-managerAssignee: Michael Stead <mstead>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.3CC: alikins, bkearney, cduryee, jsefler, mstead, pm-eus
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-13 04:35:15 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: 824530    
Bug Blocks:    

Description RHEL Program Management 2012-06-19 11:42:58 UTC
This bug has been copied from bug #824530 and has been proposed
to be backported to 6.3 z-stream (EUS).

Comment 4 Michael Stead 2012-06-19 14:19:25 UTC
fixed in: RHEL6.3.z d2deced0bb879046150999578b02dfe03ce6d4c3

Comment 6 John Sefler 2012-06-29 14:09:51 UTC
DEMONSTRATION OF FAILURE WITHOUT FIX APPLIED....

[root@rhsm-compat-rhel63 ~]# rpm -q subscription-manager
subscription-manager-0.99.19.3-1.el6_3.x86_64

[root@rhsm-compat-rhel63 ~]# grep proxy /etc/rhsm/rhsm.conf
# an http proxy server to use
proxy_hostname=
# port for http proxy server
proxy_port=
# user name for authenticating to an http proxy, if needed
proxy_user=
# password for basic http proxy auth, if needed
proxy_password=

[root@rhsm-compat-rhel63 ~]# subscription-manager config --server.hostname subscription.rhn.stage.redhat.com

[root@rhsm-compat-rhel63 ~]# subscription-manager register --autosubscribe --username stage_test_12
Password: 
The system has been registered with id: c7a77771-0037-4513-bc4f-5798685bd219 
Installed Product Current Status:
Product Name:         	Red Hat Enterprise Linux Server
Status:               	Subscribed               

[root@rhsm-compat-rhel63 ~]# subscription-manager release --list
6.1
6.2
6.3
6Server

[root@rhsm-compat-rhel63 ~]# subscription-manager release --list --proxy REDHAT:PORT --proxyuser SHADOW --proxypassword MAN
6.1
6.2
6.3
6Server
^^^^^^^  DID NOT EXPECT THIS LIST SINCE THE PROXY ARGUMENTS PASSED ON THE COMMAND LINE (REDHAT:PORT SHADOW MAN) WERE INVALID.  EXPECTED TO GET: 
Network error, unable to connect to server.
Please see /var/log/rhsm/rhsm.log for more information.

Comment 7 John Sefler 2012-06-29 14:52:54 UTC
VERIFICATION WITH FIXED PACKAGE INSTALLED...

[root@rhsm-compat-rhel63 ~]# rpm -q subscription-managersubscription-manager-0.99.19.4-1.el6_3.x86_64

[root@rhsm-compat-rhel63 ~]# subscription-manager release --list --proxy REDHAT:PORT --proxyuser SHADOW --proxypassword MAN
Network error, unable to connect to server.
Please see /var/log/rhsm/rhsm.log for more information.

^^^ VERIFIED EXPECTED RESULT WHEN INVALID COMMAND LINE PROXY ARGS ARE SPECIFIED.

NOW, LET'S VERIFY WITH VALID COMMAND LINE PROXY ARGS...

[root@rhsm-compat-rhel63 ~]# subscription-manager release --list --proxy auto-services.usersys.redhat.com:3128 --proxyuser redhat --proxypassword ***
6.1
6.2
6.3
6Server

[root@auto-services ~]# tail -f /var/log/squid/access.log
1340997632.274    862 10.16.120.159 TCP_MISS/200 4114 CONNECT cdn.redhat.com:443 redhat DIRECT/184.26.128.251 -

^^^ VERIFIED THAT WHEN VALID COMMAND LINE PROXY ARGS ARE SPECIFIED
TRAFFIC FLOWS THROUGH THE PROXY AND THE EXPECTED RESULTS ARE RETURNED.

NOW, LET'S VERIFY WHEN VALID PROXY ARGS ARE SPECIFIED VIA THE rhsm.conf FILE...

[root@rhsm-compat-rhel63 ~]# subscription-manager config --server.proxy_hostname=auto-services.usersys.redhat.com --server.proxy_port=3128 --server.proxy_user=redhat --server.proxy_password=***

[root@rhsm-compat-rhel63 ~]# subscription-manager release --list
6.1
6.2
6.3
6Server

[root@auto-services ~]# tail -f /var/log/squid/access.log
1340998420.168    779 10.16.120.159 TCP_MISS/200 4114 CONNECT cdn.redhat.com:443 redhat DIRECT/184.26.128.251 -

^^^ VERIFIED THAT TRAFFIC FLOWS THROUGH THE PROXY WHEN VALID PROXY CREDENTIALS ARE CONFIGURED IN THE rhsm.conf.

NOW, LET'S VERIFY THAT A WHEN A BOGUS PROXY IS SPECIFIED ON THE COMMAND LINE, IT WILL TAKE PRECEDENCE OVER THE VALID PROXY CONFIGURED IN rhsm.conf...

[root@rhsm-compat-rhel63 ~]# subscription-manager release --list --proxy=REDHAT:PORT
Network error, unable to connect to server.
Please see /var/log/rhsm/rhsm.log for more information.

^^^ VERIFIED

Moving bug status to VERIFIED

Comment 9 errata-xmlrpc 2012-07-13 04:35:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-1073.html