Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1784331

Summary: 422 returned instead of 404 on providing non-existing template-kind-name in POST request to provisioning_templates
Product: Red Hat Satellite Reporter: Roman Plevka <rplevka>
Component: Provisioning TemplatesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NOTABUG QA Contact: Roman Plevka <rplevka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7.0CC: apatel, mhulan, tbrisker
Target Milestone: 6.7.0Keywords: 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: 2020-02-23 14:41:49 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:

Description Roman Plevka 2019-12-17 09:27:44 UTC
Description of problem:
This outcome seems reasonable, but it is a changed behaviour since 6.6 and I'm not sure it was intended (planned).

POST request:
https://my-sat-host/api/v2/provisioning_templates with data {"provisioning_template": {
    "snippet": false,
    "name": "GeKoakiIMv",
    "template": "fooooo", 
    "template_kind_name": "non-existing",
    "template_kind_id": null
    }
}

response:
Received HTTP 422 response: {
  "error": {"message":"Could not find template_kind with name: uFldTJsOqi"}
}

respons prior to 6.7:
Received HTTP 404 response: {"message":"Could not find template_kind with name: qafkXvkXKX"}

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


Expected results:
not sure.

Additional info:

Comment 3 Tomer Brisker 2020-02-23 14:41:49 UTC
This behaviour change is expected. Previous response code was incorrect. 
See: https://theforeman.org/manuals/1.24/index.html#Upgradewarnings, https://bugzilla.redhat.com/show_bug.cgi?id=1692753. 
Closing as NOATBUG.