Bug 790481

Summary: RFE: Send subscription-manager version in the X-HTTP headers
Product: Red Hat Enterprise Linux 6 Reporter: Lukas Zapletal <lzap>
Component: python-rhsmAssignee: Bryan Kearney <bkearney>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: low Docs Contact:
Priority: low    
Version: 6.3CC: bkearney, gxing, jsefler
Target Milestone: rcKeywords: FutureFeature
Target Release: 6.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 09:50:13 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: 771481    

Description Lukas Zapletal 2012-02-14 16:21:07 UTC
In katello we can hit some compatibility issues and it would be nice to have this kind of header for future purposes.

Comment 3 RHEL Program Management 2012-07-10 08:48:36 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 4 RHEL Program Management 2012-07-11 01:48:11 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 5 xingge 2012-09-05 07:30:23 UTC
I would like to develop test case for the issue, but I can not get more detailed information over the issue, could you help provide the design details of it or detailed test steps on how to verify it?

Comment 6 Bryan Kearney 2012-10-22 19:33:35 UTC
fixed in master at ffc507e1b8ea491eadb9977db51a1367e01cabd6.

Comment 7 Lukas Zapletal 2012-11-06 09:33:40 UTC
If it's possible to configure RHSM without SSL, just go ahead and use proxy or tcpdump to see the request. If not, I can build rhsm and try it against Katello, but we are currently not expecting the header, I would need to create a code that would dump headers in katello logs.

Comment 10 Lukas Zapletal 2012-12-10 15:39:51 UTC
I recommend to patch either rhsm or katello to print out headers to a log or something. You can find controller which is needed to be patched in routes.rb in Katello for example, just put a simple "debug(params)" in the controller.

Or if you find it easier on the rhsm side, that is possible too. I don't know rhsm codebase well so I don't have advice where to add this print line.

Comment 11 John Sefler 2012-12-10 19:04:01 UTC
Verifying Version....
[root@jsefler-6 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.7.21-1
subscription-manager: 1.1.11-1.el6
python-rhsm: 1.1.6-1.el6
[root@jsefler-6 ~]# 


On the candlepin server, I can set the following in /etc/candlepin/candlepin.conf
log4j.logger.org.candlepin.servlet.filter.logging.LoggingFilter=DEBUG
Then restart tomcat and tail the log...
[root@jsefler-f14-candlepin candlepin]# service tomcat6 restart
Stopping tomcat6:                                          [  OK  ]
Starting tomcat6:                                          [  OK  ]
[root@jsefler-f14-candlepin candlepin]# tail -f /var/log/tomcat6/catalina.out

While tailing the log, I run "subscription-manager identity" from the system and then I can see the header information scroll by in catalina.out...

Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - 
Request: GET  https://jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin/
====Headers====
  host: jsefler-f14-candlepin.usersys.redhat.com:8443
  accept-encoding: identity
  content-length: 0
  accept-language: en-us
  x-subscription-manager-version: 1.1.11-1.el6
  x-python-rhsm-version: 1.1.6-1.el6
  accept: application/json
  content-type: application/json
====Headers====
Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - ====RequestBody====
Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - 
Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - 
====Response====
  Status: 200
  Content-type: application/json
====Response====
Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - ====ResponseBody====
Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - [{"rel":"admin","href":"/admin"},{"rel":"users","href":"/users"},{"rel":"atom","href":"/atom"},{"rel":"serials","href":"/serials"},{"rel":"consumers","href":"/consumers"},{"rel":"consumertypes","href":"/consumertypes"},{"rel":"content","href":"/content"},{"rel":"crl","href":"/crl"},{"rel":"entitlements","href":"/entitlements"},{"rel":"events","href":"/events"},{"rel":"jobs","href":"/jobs"},{"rel":"owners","href":"/owners"},{"rel":"pools","href":"/pools"},{"rel":"products","href":"/products"},{"rel":"rules","href":"/rules"},{"rel":"statistics/generate","href":"/statistics/generate"},{"rel":"status","href":"/status"},{"rel":"subscriptions","href":"/subscriptions"},{"rel":"activation_keys","href":"/activation_keys"},{"rel":"roles","href":"/roles"},{"rel":"migrations","href":"/migrations"},{"rel":"hypervisors","href":"/hypervisors"},{"rel":"","href":"/"}]
Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - 
Request: GET  https://jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin/status
====Headers====
  host: jsefler-f14-candlepin.usersys.redhat.com:8443
  accept-encoding: identity
  content-length: 0
  accept-language: en-us
  x-subscription-manager-version: 1.1.11-1.el6
  x-python-rhsm-version: 1.1.6-1.el6
  accept: application/json
  content-type: application/json
====Headers====
Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - ====RequestBody====
Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - 
Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - 
====Response====
  Status: 200
  Content-type: application/json
====Response====
Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - ====ResponseBody====
Dec 10 13:59:02 [http-8443-1] DEBUG org.candlepin.servlet.filter.logging.LoggingFilter - {"result":true,"version":"0.7.21","release":"1","standalone":false,"timeUTC":"2012-12-10T18:59:02.461+0000"}



^^^ NOTICE that the ==Headers== logged above contains the version info:
  x-subscription-manager-version: 1.1.11-1.el6
  x-python-rhsm-version: 1.1.6-1.el6

Moving this bugzilla to VERIFIED

Comment 13 errata-xmlrpc 2013-02-21 09:50:13 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-2013-0371.html