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 1632283 - [RFE] subscription-manager and syspurpose should warn when setting a role, addon, usage, or SLA not available for the organization.
Summary: [RFE] subscription-manager and syspurpose should warn when setting a role, ad...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On: 1618398 1632253
Blocks: 1661414
TreeView+ depends on / blocked
 
Reported: 2018-09-24 14:39 UTC by Kevin Howell
Modified: 2023-12-15 16:10 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 01:38:37 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1634023 0 unspecified CLOSED [RFE] - Provide a way to list the valid syspurpose values for end user 2023-12-15 16:10:45 UTC
Red Hat Product Errata RHBA-2020:4460 0 None None None 2020-11-04 01:38:57 UTC

Internal Links: 1634023

Description Kevin Howell 2018-09-24 14:39:25 UTC
Description of problem: When setting role, addon, usage, or SLA, subscription-manager should query available values for the org, and display an appropriate warning.

Comment 1 Craig Donnelly 2018-09-26 22:42:36 UTC
It is worth nothing that this blocks registration in its current state:

[root@unused syspurpose]# rpm -q subscription-manager
subscription-manager-1.23.6-1.el8.x86_64
[root@unused syspurpose]# syspurpose set-sla BAD
service_level_agreement set to BAD
Unable to read consumer certificate: Error loading certificate: [Errno 2] No such file or directory: '/etc/pki/consumer/cert.pem'
Unable to sent system purpose to candlepin server
[root@unused syspurpose]# subscription-manager register --username xx --password xx
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
HTTP error (400 - Bad Request): Service level "BAD" is not available to units of organization 11336955.
[root@unused syspurpose]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Unknown

System Purpose Status: Unknown

[root@unused syspurpose]# subscription-manager identity
This system is not yet registered. Try 'subscription-manager register --help' for more information.

Comment 2 qianzhan 2018-11-02 08:38:24 UTC
(In reply to Craig Donnelly from comment #1)
> It is worth nothing that this blocks registration in its current state:
> 

See Also: https://bugzilla.redhat.com/show_bug.cgi?id=1641414

Comment 9 Rehana 2020-09-09 14:50:54 UTC
With a latest subscription manager version, containing the feature to list system purpose values  Bug 1634023 we have also incorporated this request . Below is the small demonstration of them 

# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.1.18-1
subscription management rules: 5.41
subscription-manager: 1.27.15-1.el8

On registered system , try setting invalid system purpose values 
# subscription-manager list --installed 
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 High Touch Beta
Product ID:     230
Version:        8.3 HTB
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         12/11/2019
Ends:           12/10/2020

# subscription-manager role --set=bar
Warning: Provided value "bar" is not included in the list of valid values
 - Red Hat Enterprise Linux Workstation
 - Red Hat Enterprise Linux Server
 - Red Hat Enterprise Linux Compute Node
role set to "bar".

# subscription-manager usage --set=test
Warning: Provided value "test" is not included in the list of valid values
 - Development/Test
 - Production
 - Disaster Recovery
usage set to "test".

# subscription-manager usage --set=QE
Warning: Provided value "QE" is not included in the list of valid values
 - Development/Test
 - Production
 - Disaster Recovery
usage set to "QE".

^^ Notice that we currently show a warning message when user trying to set system purpose values to an invalid data.We still honour the data provided by user and set the value , but we hope this extra line of warning will help users validate the value.
  
# syspurpose show
{
  "role": "bar",
  "service_level_agreement": "foo",
  "usage": "QE"
}


On a unregistered a system , when username/password/org details are provided the current implementation also displays the warning message 

# subscription-manager identity
This system is not yet registered. Try 'subscription-manager register --help' for more information.

# subscription-manager role --username=****** --password=***** --set=foo
Organization: *****
Warning: Provided value "foo" is not included in the list of valid values
 - Red Hat Enterprise Linux Workstation
 - Red Hat Enterprise Linux Server
 - Red Hat Enterprise Linux Compute Node
role set to "foo".

# subscription-manager service-level --username=****** --password=***** --set=foo
Organization: *****
Warning: Provided value "foo" is not included in the list of valid values
 - Dev-Enterprise
 - Layered
 - Standard
 - Premium
 - Self-Support
service_level_agreement set to "foo".

# subscription-manager usage --username=****** --password=***** --set=foo
Organization: ******
Warning: Provided value "foo" is not included in the list of valid values
 - Development/Test
 - Production
 - Disaster Recovery
usage set to "foo".

# syspurpose show
{
  "role": "foo",
  "service_level_agreement": "foo",
  "usage": "foo"
}

With the improvement provided above, Verifying this bug against RHEL 83.

Comment 13 errata-xmlrpc 2020-11-04 01:38:37 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 (subscription-manager bug fix and enhancement update), 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-2020:4460


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