Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix travis failure in manageiq-content repo. #18115

Merged
merged 1 commit into from
Oct 23, 2018

Conversation

lfu
Copy link
Member

@lfu lfu commented Oct 22, 2018

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 from build_stack_create_options to job_options. The job_options method, which is an alias of stack_options, calls build_stack_create_options if the data is not provided by get_option(:create_options) here https://github.com/ManageIQ/manageiq/blob/master/app/models/mixins/service_orchestration_options_mixin.rb

By moving with_indifferent_access this change ensure it is called on the hash returned from job_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

@miq-bot
Copy link
Member

miq-bot commented Oct 22, 2018

Checked commit lfu@4208384 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@gmcculloug gmcculloug closed this Oct 22, 2018
@gmcculloug gmcculloug reopened this Oct 22, 2018
@gmcculloug gmcculloug merged commit 47f37ea into ManageIQ:master Oct 23, 2018
@gmcculloug gmcculloug added this to the Sprint 97 Ending Oct 22, 2018 milestone Oct 23, 2018
@lfu lfu deleted the service_tower_options branch July 29, 2019 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants