-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Isbm osfinger ubuntu fix #35227
Conversation
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why changing this?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. 👍
@cachedout this fixes the issue and is checked. Just a reminder. 😉 |
It's on my list. :] I'll likely get to it today. Thanks for the bump, @isbm |
Refs saltstack#35227 These tests will need to be changed back to integers once Nitrogen is released.
What does this PR do?
Bugfix PR.
What issues does this PR fix or reference?
oscodename
has not been taken properly from the platform modulePrevious Behavior
The
osfinger
grain for Ubuntu systems has been returning only name and major release included, resulting to e.g.Ubuntu-16
instead of expectedUbuntu-16.04
orUbuntu-16.10
.New Behavior
The
osfinger
grain for Ubuntu is now reported with a minor version included. Example:Tests written?
Yes
Cc: @nmadhok please take a look