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 1665022 - Syspurpose commands should display the same message as subscription-manager when there is conflict in system purpose values between server and client
Summary: Syspurpose commands should display the same message as subscription-manager w...
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
medium
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 1739697
TreeView+ depends on / blocked
 
Reported: 2019-01-10 09:58 UTC by Rehana
Modified: 2020-11-04 01:39 UTC (History)
4 users (show)

Fixed In Version: subscription-manager-1.25.6-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1739697 (view as bug list)
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 Product Errata RHBA-2020:4460 0 None None None 2020-11-04 01:38:57 UTC

Description Rehana 2019-01-10 09:58:46 UTC
Description of problem:
Syspurpose commands should displays the same message as subscription-manager when there is conflict in syspurpose values between server and client 

Version-Release number of selected component (if applicable):
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.3.12-1
subscription management rules: 5.30
subscription-manager: 1.23.8-12.el8

How reproducible:
Always 

Steps to Reproduce:
1.Register system to server
2.Set systempurpose value on the system
# syspurpose set-role "RHEL Server"; syspurpose set-sla "Premium"; syspurpose set-usage "Production"; syspurpose show
role set to RHEL Server
System purpose successfully sent to subscription management server.
service_level_agreement set to Premium
System purpose successfully sent to subscription management server.
usage set to Production
System purpose successfully sent to subscription management server.
{
  "role": "RHEL Server",
  "service_level_agreement": "Premium",
  "usage": "Production"
}
System purpose successfully sent to subscription management server.

3. 
# cat new_syspurpose 
{
"usage" : "Development"
}

4. Modify the usage values from server 
 curl -ik -u username:password --request PUT "https://subscription.rhsm.stage.redhat.com:443/subscription/consumers/a57325d5-2e12-4c3c-970d-d5819d74bb02" -d @./new_syspurpose --header "Content-Type: application/json"

5.Now try to set value for usage with systempurpose tool

# syspurpose set-usage "foo"
usage set to foo
System purpose successfully sent to subscription management server.


Actual results:
Observed that no conflicting message appeared , the data was successfully set 

Expected results:
Message "Due to a conflicting change made at the server the usage has not been set.
If you'd like to overwrite the server side change please run: subscription-manager usage --set Disaster Recovery" should be displayed 

Additional info:
Message displayed when try to set the usage value using subscription-manager command 

# subscription-manager usage --set "Disaster Recovery"
Due to a conflicting change made at the server the usage has not been set.
If you'd like to overwrite the server side change please run: subscription-manager usage --set Disaster Recovery
[root@kvm-01-guest29 ~]# subscription-manager usage --set "Disaster Recovery"
usage set to "Disaster Recovery".

Comment 3 Chris Snyder 2019-05-28 15:53:11 UTC
This is in the latest build for RHEL 8.1. Moving to MODIFIED.

Comment 6 Rehana 2020-07-21 11:24:53 UTC
Verifying on : 
=============

# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.1.16-1
subscription management rules: 5.40
subscription-manager: 1.27.10-1.el8

[root@kvm-07-guest26 ~]# rpm -qa subscr* --changelog | grep 1665022
- 1665022: Syspurpose client to have the same behavior as SubMan when in

[root@kvm-07-guest26 ~]# subscription-manager register --serverurl=https://subscription.rhsm.stage.redhat.com:443/subscription
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: username
Password: 
The system has been registered with ID: 1f5900f8-c578-43c1-a7cd-957497ccb418
The registered system name is: kvm-07-guest26.hv2.lab.eng.bos.redhat.com

[root@kvm-07-guest26 ~]# syspurpose set-role "RHEL Server"; syspurpose set-sla "Premium"; syspurpose set-usage "Production"; syspurpose show
role set to "RHEL Server".
service_level_agreement set to "Premium".
usage set to "Production".
{
  "role": "RHEL Server",
  "service_level_agreement": "Premium",
  "usage": "Production"
}
[root@kvm-07-guest26 ~]# vi new_syspurpose
[root@kvm-07-guest26 ~]# curl -ik -u rhel8_rhsm_testing_1:redhat --request PUT "https://subscription.rhsm.stage.redhat.com:443/subscription/consumers/1f5900f8-c578-43c1-a7cd-957497ccb418" -d @./new_syspurpose --header "Content-Type: application/json"
HTTP/1.1 204 No Content
Server: openresty/1.17.8.1
Date: Tue, 21 Jul 2020 11:22:29 GMT
Connection: keep-alive
x-candlepin-request-uuid: e21d5bef-88cf-4205-9e40-a43a6caff6ec
X-Version: 3.1.16-1

UPDATE value at server side 

[root@kvm-07-guest26 ~]# syspurpose set-usage "foo"
Warning: A usage of "Development" was recently set for this system by the entitlement server administrator.
If you'd like to overwrite the server side change please run: syspurpose set usage "foo"

^^ notice a warning message is appearing now . 

Based on the above observation moving the bug to verified.

Comment 9 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.