Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1150150

Summary: when you attach or remove subscriptions with OStree content, Ostree update report should log updates in proper section
Product: Red Hat Enterprise Linux 7 Reporter: Shwetha Kallesh <skallesh>
Component: subscription-managerAssignee: William Poteat <wpoteat>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: alikins, bcl, bkearney, crog, stoner, 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: 2015-11-19 11:48:14 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:    
Bug Blocks: 1121117    

Description Shwetha Kallesh 2014-10-07 14:22:04 UTC
Description of problem:
observed that when you attach subscriptions with OStree content, Ostree update report is logging updates in both added and deleted section and when you remove a subscription with ostree content nothing is being logged in the ostree update report sections
Version-Release number of selected component (if applicable):


-bash-4.2# subscription-manager  version
server type: Red Hat Subscription Management
subscription management server: 0.9.26-1
subscription management rules: 5.11
subscription-manager: 1.12.5-1.git.9.1a03d02.el7
python-rhsm: 1.12.3-1.el7


How reproducible:


Steps to Reproduce:
-bash-4.2# subscription-manager attach --auto
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

Product Name: Red Hat Enterprise Linux Atomic Host
Status:       Subscribed

-bash-4.2# tail -f /var/log/rhsm/rhsm.log

2014-10-07 14:00:57,097 [DEBUG] subscription-manager @model.py:422 - old_refspec: rhel-atomic-preview-ostree:rhel-atomic-host/7/x86_64/standard
2014-10-07 14:00:57,097 [DEBUG] subscription-manager @model.py:423 - new_refspec: rhel-atomic-preview-ostree:rhel-atomic-host/7/x86_64/standard
2014-10-07 14:00:57,097 [DEBUG] subscription-manager @model.py:431 - No change to refspec in /ostree/deploy/rhel-atomic-host/deploy/7ea291ddcec9e2451616f77808386794a62befb274642e07e932bc4f817dd6a1.0.origin
2014-10-07 14:00:57,098 [DEBUG] subscription-manager @action_invoker.py:84 - Ostree update report: Ostree repo updates

Updates:
remote "rhel-atomic-preview-ostree"
	url: /content/preview/rhel/atomic/7/x86_64/ostree/repo
	gpg-verify: False
	tls-client-cert-path: /etc/pki/entitlement/4502486204216065721.pem
	tls-client-key-path: /etc/pki/entitlement/4502486204216065721-key.pem
	tls-ca-path: None
Added:
remote "rhel-atomic-preview-ostree"
	url: /content/preview/rhel/atomic/7/x86_64/ostree/repo
	gpg-verify: False
	tls-client-cert-path: /etc/pki/entitlement/4502486204216065721.pem
	tls-client-key-path: /etc/pki/entitlement/4502486204216065721-key.pem
	tls-ca-path: None
Deleted:
remote "rhel-atomic-preview-ostree"
	url: /content/preview/rhel/atomic/7/x86_64/ostree/repo
	gpg-verify: False
	tls-client-cert-path: /etc/pki/entitlement/4502486204216065721.pem
	tls-client-key-path: /etc/pki/entitlement/4502486204216065721-key.pem
	tls-ca-path: None
2014-10-07 14:00:57,100 [DEBUG] subscription-manager @entbranding.py:47 - BrandInstaller ent_certs:  []


Removing a subscription:

-bash-4.2# subscription-manager  remove --all
1 subscription removed at the server.
1 local certificate has been deleted.

-bash-4.2# tail -f /var/log/rhsm/rhsm.log
2014-10-07 14:12:34,729 [DEBUG] subscription-manager @model.py:363 - First portion of previous ref: rhel-atomic-host
2014-10-07 14:12:34,729 [DEBUG] subscription-manager @model.py:394 - new_remote: None
2014-10-07 14:12:34,729 [WARNING] subscription-manager @model.py:396 - Unable to find matching remote for origin: rhel-atomic-preview-ostree:rhel-atomic-host/7/x86_64/standard
2014-10-07 14:12:34,729 [WARNING] subscription-manager @model.py:397 - Leaving refspec in /ostree/deploy/rhel-atomic-host/deploy/7ea291ddcec9e2451616f77808386794a62befb274642e07e932bc4f817dd6a1.0.origin
2014-10-07 14:12:34,729 [DEBUG] subscription-manager @model.py:416 - No ostree remote urls found in content.
2014-10-07 14:12:34,730 [DEBUG] subscription-manager @action_invoker.py:84 - Ostree update report: Ostree repo updates

Updates:

Added:

Deleted:




Actual results:


Expected results:
when you attach a subscription only Added section should be logged with updates 

and when you remove a subscription Deleted section should be logged with updates

Additional info:

Comment 3 Adrian Likins 2015-08-13 21:19:23 UTC
*** Bug 1253074 has been marked as a duplicate of this bug. ***

Comment 4 Adrian Likins 2015-08-14 15:55:45 UTC
fix in master

commit cf0c9a652cc62ed06c5b1ef14922a5de4a749cef
Author: William Poteat <wpoteat>
Date:   Thu Aug 13 08:23:01 2015 -0400

    1150150: Ostree update report should log updates in proper section

Comment 6 John Sefler 2015-08-18 20:48:24 UTC
Verifying Version...
[root@jsefler-7 ~]# rpm -q subscription-manager-plugin-ostree ostree
subscription-manager-plugin-ostree-1.15.9-6.el7.x86_64
ostree-2015.6-4.atomic.el7.x86_64




Adding a subscription.....

[root@jsefler-7 ~]# subscription-manager attach --auto


Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Atomic Host
Status:       Subscribed

Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@jsefler-7 ~]# tail -f /var/log/rhsm/rhsm.log
2015-08-18 15:09:50,198 [INFO] subscription-manager:10084 @ostree_content.py:34 - ostree update_content_hook plugin.
2015-08-18 15:09:50,199 [DEBUG] subscription-manager:10084 @__init__.py:85 - Searching for content of type: ostree
2015-08-18 15:09:50,200 [DEBUG] subscription-manager:10084 @config.py:199 - full_url: https://cdn.redhat.com/content/dist/rhel/atomic/7/7Server/x86_64/ostree/repo
2015-08-18 15:09:50,317 [DEBUG] subscription-manager:10084 @action_invoker.py:90 - Ostree update report: Ostree repo updates

Updates:

Added:
remote "rhel-atomic-host-ostree"
	url: /content/dist/rhel/atomic/7/7Server/x86_64/ostree/repo
	gpg-verify: False
	tls-client-cert-path: /etc/pki/entitlement/9068605545642672994.pem
	tls-client-key-path: /etc/pki/entitlement/9068605545642672994-key.pem
	tls-ca-path: None
Deleted:

2015-08-18 15:09:50,324 [DEBUG] subscription-manager:10084 @entbranding.py:47 - BrandInstaller ent_certs:  []




Removing a subscription.....

[root@jsefler-7 ~]# subscription-manager  remove --all
1 subscription removed at the server.
1 local certificate has been deleted.

[root@jsefler-7 ~]# tail -f /var/log/rhsm/rhsm.log
2015-08-18 16:10:17,491 [INFO] subscription-manager:13753 @ostree_content.py:34 - ostree update_content_hook plugin.
2015-08-18 16:10:17,492 [DEBUG] subscription-manager:13753 @__init__.py:85 - Searching for content of type: ostree
2015-08-18 16:10:17,607 [DEBUG] subscription-manager:13753 @action_invoker.py:90 - Ostree update report: Ostree repo updates

Updates:

Added:

Deleted:
remote "rhel-atomic-host-ostree"
	url: https://cdn.redhat.com/content/dist/rhel/atomic/7/7Server/x86_64/ostree/repo
	gpg-verify: false
	tls-client-cert-path: /etc/pki/entitlement/9068605545642672994.pem
	tls-client-key-path: /etc/pki/entitlement/9068605545642672994-key.pem
	tls-ca-path: /etc/rhsm/ca/redhat-uep.pem
2015-08-18 16:10:17,611 [DEBUG] subscription-manager:13753 @entbranding.py:47 - BrandInstaller ent_certs:  []




Updating a subscription....

[root@jsefler-7 ~]# /usr/libexec/rhsmcertd-worker 
Updating entitlement certificates & repositories
Total updates: 0
Found (local) serial# [7555636081254561814L]
Expected (UEP) serial# [7555636081254561814]
Added (new)
  <NONE>
Deleted (rogue):
  <NONE>
Report
        status: 1
        updates: []
        exceptions: 
        
Fact updates
        status: None
        updates: []
        exceptions: 
        
Package profile updates
        status: 0
        updates: []
        exceptions: 
        
Installed Products
        status: 0
        updates: []
        exceptions: 


[root@jsefler-7 ~]# tail -f /var/log/rhsm/rhsm.log        
2015-08-18 16:40:41,952 [INFO] rhsmcertd-worker:16376 @ostree_content.py:34 - ostree update_content_hook plugin.
2015-08-18 16:40:41,954 [DEBUG] rhsmcertd-worker:16376 @__init__.py:85 - Searching for content of type: ostree
2015-08-18 16:40:41,956 [DEBUG] rhsmcertd-worker:16376 @config.py:199 - full_url: https://cdn.redhat.com/content/dist/rhel/atomic/7/7Server/x86_64/ostree/repo
2015-08-18 16:40:42,069 [DEBUG] rhsmcertd-worker:16376 @action_invoker.py:90 - Ostree update report: Ostree repo updates

Updates:

Added:
remote "rhel-atomic-host-ostree"
	url: /content/dist/rhel/atomic/7/7Server/x86_64/ostree/repo
	gpg-verify: False
	tls-client-cert-path: /etc/pki/entitlement/7555636081254561814.pem
	tls-client-key-path: /etc/pki/entitlement/7555636081254561814-key.pem
	tls-ca-path: None
Deleted:
remote "rhel-atomic-host-ostree"
	url: https://cdn.redhat.com/content/dist/rhel/atomic/7/7Server/x86_64/ostree/repo
	gpg-verify: false
	tls-client-cert-path: /etc/pki/entitlement/7555636081254561814.pem
	tls-client-key-path: /etc/pki/entitlement/7555636081254561814-key.pem
	tls-ca-path: /etc/rhsm/ca/redhat-uep.pem
2015-08-18 16:40:42,074 [DEBUG] rhsmcertd-worker:16376 @base_action_client.py:85 - running lib: <subscription_manager.factlib.FactsActionInvoker object at 0x17178d0>




VERIFIED: When adding a subscription that provides ostree content, the rhsm.log now reports the changes to /etc/ostree/remotes.d/redhat.conf in the "Added" section of the log.

VERIFIED: When removing a subscription that provides ostree content, the rhsm.log now reports the changes to /etc/ostree/remotes.d/redhat.conf in the "Deleted" section of the log

VERIFIED: When updating a subscription that provides ostree content, the rhsm.log now reports the changes to /etc/ostree/remotes.d/redhat.conf in both the "Added" and "Deleted" section of the log  (I'm not entirely sure if this is the desired behavior).

Comment 7 errata-xmlrpc 2015-11-19 11:48:14 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.

https://rhn.redhat.com/errata/RHBA-2015-2122.html