Skip to content

Check that docker_version is not nil before using it #770

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

Closed

Conversation

johanfleury
Copy link
Contributor

@johanfleury johanfleury commented Aug 26, 2021

Fixes #769 and #771.

@johanfleury johanfleury requested a review from a team as a code owner August 26, 2021 17:05
kenyon
kenyon previously approved these changes Aug 26, 2021
@johanfleury
Copy link
Contributor Author

I added a fix for #771. I don’t know what @carabasdaniel tried to achieve in #759, but Facter::Core::Execution.exec is deprecated and doesn’t have a timeout parameter.

value = Facter::Core::Execution.exec(
"#{docker_command} version --format '{{json .}}'", timeout: 90
value = Facter::Core::Execution.execute(
"#{docker_command} version --format '{{json .}}'", options: {limit: 90}
Copy link
Contributor Author

@johanfleury johanfleury Aug 29, 2021

Choose a reason for hiding this comment

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

Can someone who knows ruby confirm that this is how to do it? Whatever I pass as parameter to this function is accepted.

Also, while facter’s doc says the option is called time_limit, it seems to actually be called limit in the code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess the documentation is right and it's a bug in the code, I'll open a PR to address this :-)

There are a few more issues. I opened #773 to address them.

@CLAassistant
Copy link

CLAassistant commented Sep 1, 2021

CLA assistant check
All committers have signed the CLA.

@adrianiurca
Copy link
Contributor

Hey @johanfleury, there seem to be some rubocop offenses. Could you please run rubocop -a and commit again in order to have spec tests green.

kind regards,
@adrianiurca

@johanfleury
Copy link
Contributor Author

PR #773 supersede this one, I’ll close it.

@johanfleury johanfleury closed this Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker fact fails when docker is not installed
5 participants