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

AIX: Set os_version to match the output of oslevel -s #790

Merged
merged 3 commits into from
Apr 4, 2016

Conversation

juliandunn
Copy link
Contributor

Fixes #693.

@@ -25,6 +25,6 @@

collect_data(:aix) do
os collect_os
os_version kernel[:version]
os_version shell_out("oslevel -s").stdout.split($/)[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the split accomplish?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's to hedge against whitespace appearing after the command output. Sometimes IBM utilities are not clean on this front.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add or modify the the existing test to include a shell out result with trailing whitespace?

Copy link
Contributor

Choose a reason for hiding this comment

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

^

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. By whitespace I meant linebreak :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

So any reason not to just use .strip here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could do that too; I was just copying the style from the rest of the AIX plugins. You'd prefer .strip then I take it?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a lot more clear what you're trying to do with .strip

@thommay
Copy link
Contributor

thommay commented Apr 4, 2016

👍

1 similar comment
@tas50
Copy link
Contributor

tas50 commented Apr 4, 2016

👍

@tas50 tas50 merged commit 793d22e into chef:master Apr 4, 2016
@tas50 tas50 changed the title Set os_version to match the output of oslevel -s AIX: Set os_version to match the output of oslevel -s Apr 4, 2016
@tas50 tas50 added the Bug label Apr 4, 2016
@thommay thommay added Type: Bug Does not work as expected. and removed Bug labels Jan 24, 2017
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants