Bug 1386738

Summary: API Creating activation key with unsupported service level paused tasks instead of failing
Product: Red Hat Satellite Reporter: Peter Vreman <peter.vreman>
Component: API - ContentAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Brad Buckingham <bbuckingham>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.2CC: bbuckingham, jcallaha
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-02-21 16:39:50 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:
Bug Depends On:    
Bug Blocks: 1122832    

Description Peter Vreman 2016-10-19 14:30:26 UTC
Description of problem:
When a Service Level is not available a task is paused instead of failing or failing in the planned state


[crash] root@li-lc-1578:~# sudo -u hoici hammer -c /opt/hoici/etc/sat6/hammer-hoici.yaml activation-key create --organization-id=3 --name TestKeyA
Activation key created

[crash] root@li-lc-1578:~# sudo -u hoici hammer -c /opt/hoici/etc/sat6/hammer-hoici.yaml activation-key update --organization-id=3 --name=TestKeyA --service-level=Dummy
Could not update the activation key:
  Task 6154487e-4290-4cb9-bb3d-53328ad7f0f1: Katello::Errors::CandlepinError: Service level 'Dummy' is not available to units of organization Hilti.

Task output:

 Id: 6154487e-4290-4cb9-bb3d-53328ad7f0f1
Label: Actions::Katello::ActivationKey::Update
Name: Update
Owner: hoici
Execution type: Delayed
Start at: 2016-10-19 16:27:10 +0200
Start before: -
Started at: 2016-10-19 16:27:10 +0200
Ended at:
State: paused
Result: error
Params: activation key 'TestKeyA'; organization 'Hilti'
50.0% Complete
50%
Errors:

Service level 'Dummy' is not available to units of organization Hilti.





Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Craete activation key TestKeyA using hammer
2. Update TestKeyA with --service-level Dummy
3.

Actual results:
Paused task

Expected results:
Error before task start or stopped task in error state

Additional info:

Comment 2 Justin Sherrill 2016-11-18 21:37:27 UTC
Connecting redmine issue http://projects.theforeman.org/issues/17401 from this bug

Comment 3 Bryan Kearney 2016-11-21 23:16:20 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17401 has been resolved.

Comment 4 Brad Buckingham 2017-08-02 16:51:34 UTC
Verified with Satellite 6.3 SNAP 9: satellite-6.3.0-16.0.beta.el7sat.noarch

Attempting to update an activation key with an invalid service-level results in a task that is in stopped/warning state.  This allows the user to try again with a valid value.

e.g.

hammer> activation-key update --organization-id 3 --name TestKeyA --service-level Dummy
Could not update the activation key:
  Task cc2dd04d-83cc-4798-b94c-36eae216f08f: Katello::Errors::CandlepinError: Service level 'Dummy' is not available to units of organization b-corp.

hammer> activation-key update --organization-id 3 --name TestKeyA --service-level Self-Support
Activation key updated
hammer>

Comment 5 Bryan Kearney 2018-02-21 16:38:41 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/RHSA-2018:0336

Comment 6 Bryan Kearney 2018-02-21 16:39:50 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/RHSA-2018:0336

Comment 7 Satellite Program 2018-02-21 16:54:17 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/RHSA-2018:0336