Bug 1775361

Summary: system purpose attributes are not set on the system when you register the system with an activation key with auto-attach=true and has all the system purpose attributes set on the key
Product: [Community] Candlepin Reporter: Shwetha Kallesh <skallesh>
Component: candlepinAssignee: ojanus
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 2.9CC: bcourt, csnyder, jsefler, nmoumoul, redakkan, skallesh
Target Milestone: ---Keywords: Regression, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: candlepin-2.12.0-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1784127 (view as bug list) Environment:
Last Closed: 2019-12-17 15:11:40 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: 1784127    

Description Shwetha Kallesh 2019-11-21 19:26:29 UTC
Description of problem:
system purpose attributes are not setl on the system when you register the system with an activation key with auto-attach=true and has all the system purpose attributes set on the key

Version-Release number of selected component (if applicable):
[root@kvm-07-guest09 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.9.18-1
subscription management rules: 5.37
subscription-manager: 1.24.23-1.el7


How reproducible:


Steps to Reproduce:
[root@kvm-07-guest09 ~]# curl --stderr /dev/null --insecure --user stage_auto_syspurpose002:redhat --request POST --data '{"role":"Red Hat Enterprise Linux Server","usage":"Production","name":"Syspurpose_keytest","serviceLevel":"Premium","autoAttach":"true"}' --header 'accept: application/json' --header 'content-type: application/json' http://candlepin.dist.stage.ext.phx2.redhat.com/candlepin/owners/12799378/activation_keys
{"created":"2019-11-21T18:49:58+0000","updated":"2019-11-21T18:49:58+0000","id":"8a99f9a86e8ab468016e8f4cb22d28a2","name":"Syspurpose_keytest","description":null,"owner":{"id":"8a99f9af6dfd1236016dfd1490430000","key":"12799378","displayName":"12799378","href":"/owners/12799378"},"serviceLevel":"Premium","usage":"Production","role":"Red Hat Enterprise Linux Server","addOns":[],"autoAttach":true,"pools":[],"contentOverrides":[],"products":[],"releaseVer":{"releaseVer":null}}[root@kvm-07-guest09 ~]# syspurpose show
{}
[root@kvm-07-guest09 ~]# subscription-manager register --org=12799378 --activationkey=Syspurpose_keytest --force
Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription
The system with UUID f24e8937-0e30-41b9-8f14-32db61f99f96 has been unregistered
All local data removed
The system has been registered with ID: dfa121a0-5a36-4b91-a95a-1d96ff14a9f9
The registered system name is: kvm-07-guest09.hv2.lab.eng.bos.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 High Touch Beta
Status:       Subscribed

[root@kvm-07-guest09 ~]# syspurpose show
{}
[root@kvm-07-guest09 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Not Specified

Actual results:
system purpose attributes are not set on the system which is affecting the system purpose status

Expected results:
system purpose attributes should be set on the system

Additional info:

Comment 1 John Sefler 2019-11-21 20:44:43 UTC
Expected the "serviceLevel":"Premium","usage":"Production","role":"Red Hat Enterprise Linux Server" properties in the activation key to propagate to the system that was registered.