Bug 1351944

Summary: auto-attach ignores invalid service level against satellite6.2
Product: Red Hat Satellite Reporter: qianzhan
Component: RegistrationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.0CC: cduryee, redakkan, skallesh, vrjain
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-02 20:57:36 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:
Attachments:
Description Flags
rhsm.log none

Description qianzhan 2016-07-01 08:33:41 UTC
Description of problem:
auto-attach ignores invalid service level against satellite6.2

Version-Release number of selected component (if applicable):
subscription-manager: 1.17.8-1.el7
python-rhsm: 1.17.4-1.el7
Satellite-6.2.0-RHEL-7.2-20160629.1

How reproducible:
always

Steps to Reproduce:
1. Register RHEL-7.3-20160629.n.0 to Satellite-6.2.0-RHEL-7.2-20160629.1, and auto-attach by specifying a wrong service level:

[root@dhcp-128-18 ~]#  subscription-manager register --username=admin --password=admin --org=Default_Organization --servicelevel=foo --auto-attach
Registering to: hp-dl2x170g6-02.rhts.eng.bos.redhat.com:443/rhsm
The system has been registered with ID: b67a62ed-b658-44f9-a738-8862ab6a2b1d 
Service level set to: foo

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

2. [root@dhcp-128-18 ~]# subscription-manager service-level --show
Service level preference not set

3. [root@dhcp-128-18 ~]# subscription-manager service-level --list
+-------------------------------------------+
               Available Service Levels
+-------------------------------------------+
Basic
Premium
Self-Support
Standard

Actual results:
As step 1, auto-attach succeeds with wrong sevice level.

Expected results:
auto-attach should fail with warning like below:

# subscription-manager register --username=admin --org=ACME_Corporation --servicelevel=foo --auto-attach
Registering to: samserv.redhat.com:443/sam/api
Password:
The system has been registered with ID: 002c1477-18a4-41b4-9412-e315ffa221de
Service level 'foo' is not available to units of organization ACME_Corporation.

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Not Subscribed

Unable to find available subscriptions for all your installed products.

Additional info:
The attachment is rhsm.log

Comment 1 qianzhan 2016-07-01 08:34:07 UTC
Created attachment 1174844 [details]
rhsm.log

Comment 4 William Poteat 2016-07-19 18:40:58 UTC
When the registration is complete in the first step, then the next step is for the service level to be set.

Without Katello in the middle, the REST exception [BadRequestException] message surfaces when the service level is not available.

Somewhere Katello is absorbing the exception here. Sub Man just assumes the service level was set because no exception was returned. Katello must allow it to pass for Sub Man to know how to behave.

Comment 5 Bryan Kearney 2016-07-26 18:55:10 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 7 Bryan Kearney 2018-08-02 20:57:36 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the forseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.