Skip to content

Commit

Permalink
Make OrchestrationService retirement work again
Browse files Browse the repository at this point in the history
With this commit we make sure retirement request validation
succeeds, because right now it's failing with:

```
[ActiveRecord::RecordInvalid]: Validation failed: OrchestrationStackRetireTask:
    Request type should be orchestration_stack_retire
```

Reason for the error above ^ is that `OrchestrationStack.class.name` gets
transformed into `orchestrationstack` while validation expects underscore
inbetween: `orchestration_stack`.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1632239

Signed-off-by: Miha Pleško <[email protected]>
  • Loading branch information
miha-plesko committed Oct 1, 2018
1 parent 150b6ef commit 338d348
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/service_retire_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def create_task(svc_rsc, parent_service, nh, parent_task)
:parent_service_id => parent_service.id,
:parent_task_id => parent_task.id,
)
task.request_type = svc_rsc.resource.type.demodulize.downcase + "_retire"
task.request_type = svc_rsc.resource.type.demodulize.underscore.downcase + "_retire"
task.source = svc_rsc.resource
parent_task.miq_request_tasks << task
task.save!
Expand Down

0 comments on commit 338d348

Please sign in to comment.