RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1424614 - [RFE] Enhance the 'rct cat-manifest' command to show manifests with the Organization/Environment Content Access Flag
Summary: [RFE] Enhance the 'rct cat-manifest' command to show manifests with the Organ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.4
Hardware: All
OS: Unspecified
high
low
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-17 20:09 UTC by Rich Jerrido
Modified: 2017-09-05 21:23 UTC (History)
5 users (show)

Fixed In Version: subscription-manager-1.19.6-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 19:20:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2083 0 normal SHIPPED_LIVE python-rhsm and subscription-manager bug fix and enhancement update 2017-08-01 18:14:19 UTC

Description Rich Jerrido 2017-02-17 20:09:17 UTC
Description of problem:


As a user of Red Hat's subscription-tooling, I may have manifests that have the 'Organization/Environment Content Access' flag set. 

As a user of rct, I'd like to introspect my manifest to see this flag when it exists and its status. Thus, I'd like to see the 'cat-manifest' subcommand updated to show this 

Version-Release number of selected component (if applicable):
ubscription-manager-1.19.1-1


Additional info:

Comment 2 Rich Jerrido 2017-03-27 23:08:19 UTC
Proposed patch here - https://github.com/candlepin/subscription-manager/pull/1567

Comment 4 Shwetha Kallesh 2017-05-12 13:35:20 UTC
Failed_qa , I see Content Access Mode as "entitlement" instead of "org_environment"

[root@bkr-hv01-guest06 ~]# subscription-manager  version
server type: Red Hat Subscription Management
subscription management server: 2.1.0-1
subscription management rules: 5.23
subscription-manager: 1.19.12-1.el7
python-rhsm: 1.19.6-1.el7


[root@bkr-hv01-guest06 ~]# curl -X PUT -k -u admin:admin   -d '{"contentAccessMode":"org_environment"}'  -H "Content-Type: application/json"  "https://Shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/snowwhite" | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   437    0   398  100    39    275     26  0:00:01  0:00:01 --:--:--   275
{
    "autobindDisabled": null,
    "contentAccessMode": "org_environment",
    "contentAccessModeList": "org_environment",
    "contentPrefix": null,
    "created": "2017-05-11T14:41:27+0000",
    "defaultServiceLevel": null,
    "displayName": "Snow White",
    "href": "/owners/snowwhite",
    "id": "8ac6a3185bf7f180015bf7f51b8c0004",
    "key": "snowwhite",
    "logLevel": null,
    "parentOwner": null,
    "updated": "2017-05-12T06:57:51+0000",
    "upstreamConsumer": null
}

[root@bkr-hv01-guest06 ~]# subscription-manager  register --type candlepin
Registering to: Shwetha-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Organization: snowwhite
The system has been registered with ID: 1cbfd163-d3c0-4cf4-9f54-0b8ff3d29a9d 

[root@bkr-hv01-guest06 ~]# curl -k -u admin:admin --request GET https://Shwetha-candlepin.usersys.redhat.com:8443/candlepin/consumers/1cbfd163-d3c0-4cf4-9f54-0b8ff3d29a9d/export >> export.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 45580    0 45580    0     0  17378      0 --:--:--  0:00:02 --:--:-- 17377


[root@bkr-hv01-guest06 ~]# rct cat-manifest export.zip 

+-------------------------------------------+
	Manifest
+-------------------------------------------+

General:
	Server: 
	Server Version: 2.1.0-1
	Date Created: 2017-05-12T13:06:06.265+0000
	Creator: admin

Consumer:
	Name: bkr-hv01-guest06.dsal.lab.eng.bos.redhat.com
	UUID: 1cbfd163-d3c0-4cf4-9f54-0b8ff3d29a9d
	Content Access Mode: entitlement
	Type: candlepin

Subscriptions:
	None

Comment 5 Kevin Howell 2017-06-07 21:47:29 UTC
Will, I reproduced using the above steps, but I'm not 100% sure the above steps reflect intended usage. i.e. does creating a consumer of type candlepin from subscription-manager reflect how the portal would actually create the consumer? It seems to me it's not incorrect that the mode is entitlement since the contentAccessMode on the consumer object is still empty?

Comment 6 William Poteat 2017-06-08 14:16:47 UTC
The contentAccessMode does not flow down to the manifest consumer. It is set explicitly on the consumer by must be an allowed mode in the onwer's contentAccessModeList.

Also, we recently realized that allowing manifest consumer creation from the SubMan command line is a bad idea. What you end up with on the client is an incorrect representation of a place-holder at the server. It is neither a working client nor a distributor. It will be blocked in Candlepin as soon as this is deployed: https://github.com/candlepin/candlepin/pull/1593

Comment 7 Kevin Howell 2017-06-13 20:46:51 UTC
Shwetha, with comment 6 in mind, can you please work with wpoteat to find a better way to test this, and then let us know if it still fails QA?

Comment 9 Kevin Howell 2017-06-22 21:58:02 UTC
Shwetha, can you please verify what happens when you create a manifest consumer with contentAccessMode set to "org_entitlement"?

Comment 12 Rehana 2017-06-23 13:55:30 UTC
Retesting with : 
subscription-manager-gui-1.19.20-1.el7.x86_64
subscription-manager-1.19.20-1.el7.x86_64
subscription-manager-initial-setup-addon-1.19.20-1.el7.x86_64

To verify :

Create customer of type Candlepin : 

# curl -H "Content-Type: application/json" -u admin:admin -X POST -k 'https://server:8443/candlepin/consumers?user=admin&owner=snowwhite' -d '{"type":{"label":"candlepin"},"name":"foobar"}' 
{
  "id" : "8ac6a3625ccedd85015cd4f490410c1c",
  "uuid" : "8747ab00-adc9-4b00-af56-947906849405",
  "name" : "foobar",
  "username" : "admin",
  "entitlementStatus" : null,
  "serviceLevel" : "",
  "releaseVer" : {
    "releaseVer" : null
<snip>

Now update consumer with contentAccessmode using the UUID from Above curl reasponse

# curl -H "Content-Type: application/json" -u admin:admin -X PUT -k 'https://sever:8443/candlepin/consumers/8747ab00-adc9-4b00-af56-947906849405' -d '{"contentAccessMode":"org_environment"}' 

Export the manifest:

# curl -H "Content-Type: application/json" -u admin:admin -k 'https://server:8443/candlepin/consumers/8747ab00-adc9-4b00-af56-947906849405/export' > /tmp/test.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 45395    0 45395    0     0   116k      0 --:--:-- --:--:-- --:--:--  116k


root@dhcp35-134 ~]# rct cat-manifest /tmp/test.zip 

+-------------------------------------------+
	Manifest
+-------------------------------------------+

General:
	Server: 
	Server Version: 2.1.1-1
	Date Created: 2017-06-23T12:39:03.993+0000
	Creator: admin

Consumer:
	Name: foobar
	UUID: 8747ab00-adc9-4b00-af56-947906849405
	Content Access Mode: org_environment --> Is now updated correctly.
	Type: candlepin

Subscriptions:
	None

Based on the above observations , moving the bug to Verified!!

Comment 13 errata-xmlrpc 2017-08-01 19:20:42 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://access.redhat.com/errata/RHBA-2017:2083


Note You need to log in before you can comment on or make changes to this bug.