Bug 1055664

Summary: rhsm-debug tool should follow the configured paths to: ca_cert_dir pluginconfdir plugindir
Product: Red Hat Enterprise Linux 7 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Adrian Likins <alikins>
Status: CLOSED CURRENTRELEASE QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: alikins, bkearney, ckozak, wpoteat
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:32:57 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:
Embargoed:
Bug Depends On: 1070737    
Bug Blocks: 863175    

Description John Sefler 2014-01-20 17:51:48 UTC
Description of problem:
Very similar to bug 1040546


Version-Release number of selected component (if applicable):
[root@jsefler-7 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.2-1
subscription-manager: 1.10.10-1.git.22.bf03c6b.el7
python-rhsm: 1.10.10-1.git.1.90486fd.el7


How reproducible:


Steps to Reproduce:
[root@jsefler-7 ~]# subscription-manager config --list | egrep "ca_cert_dir|pluginconfdir|plugindir"
   ca_cert_dir = [/etc/rhsm/ca/]
   pluginconfdir = [/etc/rhsm/pluginconf.d]
   plugindir = [/usr/share/rhsm-plugins]

[root@jsefler-7 ~]# mkdir /tmp/ca_cert_dir /tmp/pluginconfdir /tmp/plugindir

[root@jsefler-7 ~]# cp /etc/rhsm/ca/* /tmp/ca_cert_dir

[root@jsefler-7 ~]# cp /etc/rhsm/pluginconf.d/* /tmp/pluginconfdir

[root@jsefler-7 ~]# cp /usr/share/rhsm-plugins/* /tmp/plugindir

[root@jsefler-7 ~]# ls -c1 /tmp/ca_cert_dir
redhat-uep.pem
jsefler-f14-7candlepin.pem
jsefler-f14-candlepin.pem
candlepin-stage.pem

[root@jsefler-7 ~]# ls -c1 /tmp/pluginconfdir
product_id_install_test.ProductIdInstallTestPlugin.conf
register_consumer_test1.RegisterConsumerTestPlugin.conf
register_consumer_test2.RegisterConsumerTestPlugin.conf
subscribe_test.SubscribeTestPlugin.conf
facts_collection_test.FactsCollectionTestPlugin.conf
all_slots_test.AllSlotsTestPlugin.conf
auto_attach_test.AutoAttachTestPlugin.conf
dbus_event.DbusEventPlugin.conf

[root@jsefler-7 ~]# ls -c1 /tmp/plugindir
subscribe_test.pyc
register_consumer_test2.pyc
register_consumer_test1.pyc
product_id_install_test.pyc
facts_collection_test.pyc
dbus_event.pyc
auto_attach_test.pyc
all_slots_test.pyc
subscribe_test.py
register_consumer_test2.py
register_consumer_test1.py
product_id_install_test.py
facts_collection_test.py
dbus_event.py
auto_attach_test.py
all_slots_test.py

[root@jsefler-7 ~]# subscription-manager config --rhsm.ca_cert_dir=/tmp/ca_cert_dir --rhsm.pluginconfdir=/tmp/pluginconfdir --rhsm.plugindir=/tmp/plugindir

[root@jsefler-7 ~]# subscription-manager config --list | egrep "ca_cert_dir|pluginconfdir|plugindir"
   ca_cert_dir = /tmp/ca_cert_dir
   pluginconfdir = /tmp/pluginconfdir
   plugindir = /tmp/plugindir
   repo_ca_cert = /tmp/ca_cert_dirredhat-uep.pem

[root@jsefler-7 ~]# subscription-manager register --username testuser1 --password password --org admin
The system has been registered with ID: 4de2eee1-7581-4d1c-abf2-3b852faa3893 

[root@jsefler-7 ~]# rhsm-debug system
Wrote: /tmp/rhsm-debug-system-20140120-050890.tar.gz

[root@jsefler-7 ~]# tar -xvf /tmp/rhsm-debug-system-20140120-050890.tar.gz
rhsm-debug-system-20140120-050890/
rhsm-debug-system-20140120-050890/subscriptions.json
rhsm-debug-system-20140120-050890/consumer.json
rhsm-debug-system-20140120-050890/compliance.json
rhsm-debug-system-20140120-050890/entitlements.json
rhsm-debug-system-20140120-050890/pools.json
rhsm-debug-system-20140120-050890/version.json
rhsm-debug-system-20140120-050890/etc/
rhsm-debug-system-20140120-050890/etc/rhsm/
rhsm-debug-system-20140120-050890/etc/rhsm/ca/
rhsm-debug-system-20140120-050890/etc/rhsm/ca/jsefler-f14-candlepin.pem
rhsm-debug-system-20140120-050890/etc/rhsm/ca/jsefler-f14-7candlepin.pem
rhsm-debug-system-20140120-050890/etc/rhsm/ca/candlepin-stage.pem
rhsm-debug-system-20140120-050890/etc/rhsm/ca/redhat-uep.pem
rhsm-debug-system-20140120-050890/etc/rhsm/rhsm.conf.rpmsave
rhsm-debug-system-20140120-050890/etc/rhsm/pluginconf.d/
rhsm-debug-system-20140120-050890/etc/rhsm/pluginconf.d/all_slots_test.AllSlotsTestPlugin.conf
rhsm-debug-system-20140120-050890/etc/rhsm/pluginconf.d/auto_attach_test.AutoAttachTestPlugin.conf
rhsm-debug-system-20140120-050890/etc/rhsm/pluginconf.d/dbus_event.DbusEventPlugin.conf
rhsm-debug-system-20140120-050890/etc/rhsm/pluginconf.d/facts_collection_test.FactsCollectionTestPlugin.conf
rhsm-debug-system-20140120-050890/etc/rhsm/pluginconf.d/product_id_install_test.ProductIdInstallTestPlugin.conf
rhsm-debug-system-20140120-050890/etc/rhsm/pluginconf.d/register_consumer_test1.RegisterConsumerTestPlugin.conf
rhsm-debug-system-20140120-050890/etc/rhsm/pluginconf.d/register_consumer_test2.RegisterConsumerTestPlugin.conf
rhsm-debug-system-20140120-050890/etc/rhsm/pluginconf.d/subscribe_test.SubscribeTestPlugin.conf
rhsm-debug-system-20140120-050890/etc/rhsm/facts/
rhsm-debug-system-20140120-050890/etc/rhsm/facts/override.facts
rhsm-debug-system-20140120-050890/etc/rhsm/rhsm.conf
rhsm-debug-system-20140120-050890/etc/pki/
rhsm-debug-system-20140120-050890/etc/pki/product/
rhsm-debug-system-20140120-050890/etc/pki/product/88888_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/100000000000000_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/100000000000001_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/1000000000000023_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/100000000000002_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/100000000000003_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/100000000000005_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/100000000000006_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/100000000000011_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/100000000000020_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/100000000000060_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/100000000000069_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/1144_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/1_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/213412341234_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/213412341235_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/213412341236_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/213412341237_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/27060_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/32060_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/37060_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/37062_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/37065_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/37067_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/37068_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/37069_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/37070_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/37080_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/801_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/806_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/900_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/917571_.pem
rhsm-debug-system-20140120-050890/etc/pki/product/98121_.pem
rhsm-debug-system-20140120-050890/etc/pki/entitlement/
rhsm-debug-system-20140120-050890/etc/pki/consumer/
rhsm-debug-system-20140120-050890/etc/pki/consumer/key.pem
rhsm-debug-system-20140120-050890/etc/pki/consumer/cert.pem
rhsm-debug-system-20140120-050890/var/
rhsm-debug-system-20140120-050890/var/log/
rhsm-debug-system-20140120-050890/var/log/rhsm/
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsmcertd.log-20140106
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsm.log-20140106
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsmcertd.log-20140112
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsm.log.5
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsm.log.3
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsm.log.1
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsm.log-20140119
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsm.log.2
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsmcertd.log
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsm.log.4
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsm.log
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsmcertd.log-20131229
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsm.log-20131229
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsm.log-20140112
rhsm-debug-system-20140120-050890/var/log/rhsm/rhsmcertd.log-20140119
rhsm-debug-system-20140120-050890/var/lib/
rhsm-debug-system-20140120-050890/var/lib/rhsm/
rhsm-debug-system-20140120-050890/var/lib/rhsm/productid.js
rhsm-debug-system-20140120-050890/var/lib/rhsm/branded_name
rhsm-debug-system-20140120-050890/var/lib/rhsm/cache/
rhsm-debug-system-20140120-050890/var/lib/rhsm/cache/content_overrides.json
rhsm-debug-system-20140120-050890/var/lib/rhsm/cache/installed_products.json
rhsm-debug-system-20140120-050890/var/lib/rhsm/cache/entitlement_status.json
rhsm-debug-system-20140120-050890/var/lib/rhsm/facts/
rhsm-debug-system-20140120-050890/var/lib/rhsm/facts/facts.json
rhsm-debug-system-20140120-050890/var/lib/rhsm/packages/

Actual results:
above

Expected results:
The tar listing should have included all of the files listed in:
  /tmp/ca_cert_dir
  /tmp/pluginconfdir
  /tmp/plugindir

Comment 1 Adrian Likins 2014-02-18 15:10:58 UTC
I think for this case I'd rather not collect the plugins themselves, but I'll add the plugin configurations.

We can add collecting the 'plugins --list' outputs as an RFE.

Comment 2 Adrian Likins 2014-02-18 18:46:37 UTC
https://github.com/candlepin/subscription-manager/pull/911

That fixes most of it.

Comment 3 William Poteat 2014-02-26 14:49:20 UTC
master commit 025a5069108f3278becf33dcaa3cdbe31a1427cb

Comment 6 John Sefler 2014-03-04 23:14:43 UTC
Verifying Version...
[root@jsefler-7 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription-manager: 1.10.14-4.el7
python-rhsm: 1.10.12-1.el7


[root@jsefler-7 ~]# subscription-manager config --list | egrep "ca_cert_dir|pluginconfdir|plugindir"
   ca_cert_dir = [/etc/rhsm/ca/]
   pluginconfdir = [/etc/rhsm/pluginconf.d]
   plugindir = [/usr/share/rhsm-plugins]

[root@jsefler-7 ~]# mkdir /tmp/ca_cert_dir /tmp/pluginconfdir /tmp/plugindir

[root@jsefler-7 ~]# cp /etc/rhsm/ca/* /tmp/ca_cert_dir

[root@jsefler-7 ~]# cp /etc/rhsm/pluginconf.d/* /tmp/pluginconfdir

[root@jsefler-7 ~]# cp /usr/share/rhsm-plugins/* /tmp/plugindir

[root@jsefler-7 ~]# ls -c1 /tmp/ca_cert_dir
jsefler-f14-candlepin.pem
katellosach.pem
redhat-uep.pem
candlepin-stage.pem
jsefler-f14-7candlepin.pem

[root@jsefler-7 ~]# ls -c1 /tmp/pluginconfdir
subscribe_test.SubscribeTestPlugin.conf
facts_collection_test.FactsCollectionTestPlugin.conf
product_id_install_test.ProductIdInstallTestPlugin.conf
register_consumer_test1.RegisterConsumerTestPlugin.conf
register_consumer_test2.RegisterConsumerTestPlugin.conf
auto_attach_test.AutoAttachTestPlugin.conf
dbus_event.DbusEventPlugin.conf
all_slots_test.AllSlotsTestPlugin.conf

[root@jsefler-7 ~]# ls -c1 /tmp/plugindir
subscribe_test.pyc
register_consumer_test2.pyc
subscribe_test.py
register_consumer_test2.py
register_consumer_test1.py
register_consumer_test1.pyc
product_id_install_test.py
product_id_install_test.pyc
facts_collection_test.py
facts_collection_test.pyc
dbus_event.py
dbus_event.pyc
all_slots_test.pyc
auto_attach_test.py
auto_attach_test.pyc
all_slots_test.py

[root@jsefler-7 ~]# subscription-manager config --rhsm.ca_cert_dir=/tmp/ca_cert_dir --rhsm.pluginconfdir=/tmp/pluginconfdir --rhsm.plugindir=/tmp/plugindir

[root@jsefler-7 ~]# subscription-manager config --list | egrep "ca_cert_dir|pluginconfdir|plugindir"
   ca_cert_dir = /tmp/ca_cert_dir
   pluginconfdir = /tmp/pluginconfdir
   plugindir = /tmp/plugindir
   repo_ca_cert = /tmp/ca_cert_dirredhat-uep.pem

[root@jsefler-7 ~]# subscription-manager register --username=testuser1 --org=admin --serverurl=jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin
Password: 
The system has been registered with ID: f19d73e3-3d29-4fb0-b1df-872a195ea973 

[root@jsefler-7 ~]# rhsm-debug system --sos
Wrote: /tmp/rhsm-debug-system-20140304-676399.tar.gz

[root@jsefler-7 ~]# tar -tf /tmp/rhsm-debug-system-20140304-676399.tar.gz 
rhsm-debug-system-20140304-676399/
rhsm-debug-system-20140304-676399/subscriptions.json
rhsm-debug-system-20140304-676399/consumer.json
rhsm-debug-system-20140304-676399/compliance.json
rhsm-debug-system-20140304-676399/entitlements.json
rhsm-debug-system-20140304-676399/pools.json
rhsm-debug-system-20140304-676399/version.json
rhsm-debug-system-20140304-676399/tmp/
rhsm-debug-system-20140304-676399/tmp/ca_cert_dir/
rhsm-debug-system-20140304-676399/tmp/ca_cert_dir/candlepin-stage.pem
rhsm-debug-system-20140304-676399/tmp/ca_cert_dir/jsefler-f14-7candlepin.pem
rhsm-debug-system-20140304-676399/tmp/ca_cert_dir/jsefler-f14-candlepin.pem
rhsm-debug-system-20140304-676399/tmp/ca_cert_dir/katellosach.pem
rhsm-debug-system-20140304-676399/tmp/ca_cert_dir/redhat-uep.pem
rhsm-debug-system-20140304-676399/tmp/pluginconfdir/
rhsm-debug-system-20140304-676399/tmp/pluginconfdir/all_slots_test.AllSlotsTestPlugin.conf
rhsm-debug-system-20140304-676399/tmp/pluginconfdir/auto_attach_test.AutoAttachTestPlugin.conf
rhsm-debug-system-20140304-676399/tmp/pluginconfdir/dbus_event.DbusEventPlugin.conf
rhsm-debug-system-20140304-676399/tmp/pluginconfdir/facts_collection_test.FactsCollectionTestPlugin.conf
rhsm-debug-system-20140304-676399/tmp/pluginconfdir/product_id_install_test.ProductIdInstallTestPlugin.conf
rhsm-debug-system-20140304-676399/tmp/pluginconfdir/register_consumer_test1.RegisterConsumerTestPlugin.conf
rhsm-debug-system-20140304-676399/tmp/pluginconfdir/register_consumer_test2.RegisterConsumerTestPlugin.conf
rhsm-debug-system-20140304-676399/tmp/pluginconfdir/subscribe_test.SubscribeTestPlugin.conf
[root@jsefler-7 ~]# 


VERIFIED: The tar listing included all of the files listed in:
  /tmp/ca_cert_dir
  /tmp/pluginconfdir

VERIFIED: As stated in comment 1, the plugindir will NOT be collected by rhsm-debug

VERIFIED: Also verified that using the --sos option will exclude files that are not already be collected by the sos report tool -- namely /etc/pki/* /etc/rhsm/* /var/log/rhsm/* /var/lib/rhsm/*

Comment 7 Ludek Smid 2014-06-13 11:32:57 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.