Bug 1476327 - provider type not checked when creating authentications, fails with undefined method `id' for nil:NilClass
provider type not checked when creating authentications, fails with undefined...
Status: ON_DEV
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API (Show other bugs)
5.8.0
Unspecified Unspecified
high Severity medium
: GA
: cfme-future
Assigned To: James Wong
Martin Kourim
api:rest
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-28 12:03 EDT by Martin Kourim
Modified: 2017-08-08 17:09 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Kourim 2017-07-28 12:03:12 EDT
Description of problem:
When creating authentications using /api/authentications the provider type is not checked. The request fails with "undefined method `id' for nil:NilClass" when the manager_resource doesn't correspond to the "type".


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


How reproducible:
very


Steps to Reproduce:
1. POST /api/authentications
{
  "description" : "Authentication Description",
  "name" : "SomeCredentials",
  "related" : {},
  "type" : "ManageIQ::Providers::AnsibleTower::AutomationManager::Credential",
  "manager_resource" : { "href" : "https://<address>/api/providers/:id_of_existing_non_ansible_provider" }
}
2. check corresponding task


Actual results:
{
...
    "name": "Creating Ansible Tower Credential (name=SomeCredentials)",
    "state": "Finished",
    "status": "Error",
    "message": "undefined method `id' for nil:NilClass",
    "userid": "system",
...
}


Expected results:
Error message describing the problem (incorrect provider, type, etc.)
Comment 3 Martin Kourim 2017-07-28 14:38:54 EDT
Relevant parts of evm.log attached. It's apparent the Ansible Tower provider is expected even if the "manager_resource" is in fact a Foreman provider.
Comment 4 Martin Kourim 2017-07-28 14:51:17 EDT
The error is the same as described in https://bugzilla.redhat.com/show_bug.cgi?id=1476381
This error is not it's duplicate even though the error is the same. The problem this BZ is describing is that "type" is not checked with "manager_resource", not that it's not possible to create authentication on Ansible Tower.

Note You need to log in before you can comment on or make changes to this bug.