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

Isbm osfinger ubuntu fix #35227

Merged
merged 5 commits into from
Aug 9, 2016
Merged

Conversation

isbm
Copy link
Contributor

@isbm isbm commented Aug 5, 2016

What does this PR do?

Bugfix PR.

What issues does this PR fix or reference?

Previous Behavior

The osfinger grain for Ubuntu systems has been returning only name and major release included, resulting to e.g. Ubuntu-16 instead of expected Ubuntu-16.04 or Ubuntu-16.10.

New Behavior

The osfinger grain for Ubuntu is now reported with a minor version included. Example:

$ cat /etc/os-release | grep 'VERSION='
VERSION="16.04.1 LTS (Xenial Xerus)"

$ salt \* grains.get osfinger
saltdevel:
    Ubuntu-16.04

Tests written?

Yes

Cc: @nmadhok please take a look

@@ -1372,8 +1372,7 @@ def os_data():
grains.pop('lsb_distrib_release', None)
grains['osrelease'] = \
grains.get('lsb_distrib_release', osrelease).strip()
grains['oscodename'] = grains.get('lsb_distrib_codename',
oscodename).strip()
grains['oscodename'] = grains.get('lsb_distrib_codename', '').strip() or oscodename
Copy link
Contributor

Choose a reason for hiding this comment

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

Why changing this?

Copy link
Contributor Author

@isbm isbm Aug 5, 2016

Choose a reason for hiding this comment

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

Because it says before "if there is no lsb_distrib_codename, use oscodename, then .strip() everything". Which is failing, in case lsb_distrib_codename contains an empty data. In this case you are happily getting an empty string, while you already have a correct codename from the platform.linux_distribution which is set to the oscodename variable.

Hope it explains.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense. 👍

@isbm
Copy link
Contributor Author

isbm commented Aug 9, 2016

@cachedout this fixes the issue and is checked. Just a reminder. 😉

@cachedout
Copy link
Contributor

It's on my list. :] I'll likely get to it today. Thanks for the bump, @isbm

@cachedout cachedout merged commit ce7aeb6 into saltstack:2016.3 Aug 9, 2016
rallytime pushed a commit to rallytime/salt that referenced this pull request Aug 11, 2016
Refs saltstack#35227

These tests will need to be changed back to integers once Nitrogen
is released.
@isbm isbm deleted the isbm-osfinger-ubuntu-fix branch August 31, 2016 09:34
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.

3 participants