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

Cleanup Ansible::Runner #17808

Merged
merged 2 commits into from
Aug 8, 2018
Merged

Conversation

Fryguy
Copy link
Member

@Fryguy Fryguy commented Aug 6, 2018

The main cleanup in this commit is to properly leverage AwesomeSpawn's
params instead of manually building parts of the command line. Additionally,
this fixes a bug with the :cmdline substitution when an extra_var has a "'"
in it.

Additionally, parameter validation has been lumped together to raise a
single error to the caller, instead of one-by-one, and it also raises
the more specific ArgumentError.

@agrare As discussed. I'll give you access to push the specs into here.

@Fryguy Fryguy force-pushed the cleanup_ansible_runner branch 2 times, most recently from bcf0405 to 7202f09 Compare August 6, 2018 22:01
@agrare agrare force-pushed the cleanup_ansible_runner branch 2 times, most recently from 4be0749 to 527f68f Compare August 7, 2018 00:38
playbook = playbook_or_role_args[:playbook]
errors << "playbook path doesn't exist: #{playbook}" if playbook && !File.exist?(playbook)
role = playbook_or_role_args[:role]
errors << "role path doesn't exist: #{role}" if role && !File.exist?(role)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is a valid test failure, previously this checked for the existence of roles_path and role is just the name of the role not a path.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup my mistake. This is why I love specs :D

agrare and others added 2 commits August 7, 2018 12:18
The main cleanup in this commit is to properly leverage AwesomeSpawn's
params instead of manually building parts of the command line. Additionally,
this fixes a bug with the :cmdline substitution when an extra_var has a "'"
in it.

Additionally, parameter validation has been lumped together to raise a
single error to the caller, instead of one-by-one, and it also raises
the more specific ArgumentError.
@Fryguy Fryguy force-pushed the cleanup_ansible_runner branch from 25f39c1 to abf0e51 Compare August 7, 2018 16:24
@Fryguy
Copy link
Member Author

Fryguy commented Aug 7, 2018

Cleaned up some rubocops. @gtanzillo This should be good to go.

@miq-bot
Copy link
Member

miq-bot commented Aug 7, 2018

Checked commits Fryguy/manageiq@494b8aa~...abf0e51 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 1 offense detected

spec/lib/ansible/runner_spec.rb

@gtanzillo gtanzillo added this to the Sprint 92 Ending Aug 13, 2018 milestone Aug 8, 2018
@gtanzillo gtanzillo merged commit 72c19d5 into ManageIQ:master Aug 8, 2018
@Ladas
Copy link
Contributor

Ladas commented Aug 9, 2018

❤️ thanks for the specs guys :-D

If we can get runner to the CI, we could add also integration specs (actually invoking ansible-runner), so we know the runner interface is not broken.

@Fryguy Fryguy deleted the cleanup_ansible_runner branch August 10, 2018 21:17
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.

5 participants