Fix travis failure in manageiq-content repo. #18115
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When launching Ansible jobs, the job options may be expected with string hash keys. The change proposed in this PR would ensure the job options passed down to Ansible Tower always support string hash keys.
When getting a value of a hash with indifferent access based on a key, the key can be written as either string or symbol. But internally the hash key is in string format which can lead to test failures when comparing the hash.
(See the
with_indifferent_access
example here: RSpec: comparing a hash with string keys against a hash with symbol keys?)This PR moves the
with_indifferent_access
call frombuild_stack_create_options
tojob_options
. Thejob_options
method, which is an alias ofstack_options
, callsbuild_stack_create_options
if the data is not provided byget_option(:create_options)
here https://github.com/ManageIQ/manageiq/blob/master/app/models/mixins/service_orchestration_options_mixin.rbBy moving
with_indifferent_access
this change ensure it is called on the hash returned fromjob_options
regardless of the source of the hash.Followup of #18057.
Blocks ManageIQ/manageiq-content#451.
@miq-bot assign @gmcculloug
@miq-bot add_label enhancement, services
cc @mkanoor