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

Update to allow for malformed CPE_NAME from some OS's #52283

Merged
merged 1 commit into from Mar 27, 2019

Conversation

@dmurphy18
Copy link
Contributor

commented Mar 21, 2019

What does this PR do?

Allows for malformed CPE_NAME in /etc/os-release on Amazon Linux 2.
CPE_NAME if element 1 is '2.3' should contain 13 elements

cpe:2.3:part:vendor:product:version:update:edition:lang:sw_edition:target_sw:target_hw:other

However on Amazon Linux 2 only 6 elements are provided, this change compensates for this and is more flexible in retrieving other elements if an OS insufficiently provides CPE_NAME.

What issues does this PR fix or reference?

#52281

Previous Behavior

An ERROR was output stating the CPE_NAME was broken, for example:
143 2019-03-21 19:55:08,228 [salt.loaded.int.grains.core:1773][ERROR ][4113] Broken CPE_NAME format in /etc/os-release!

New Behavior

CPE_NAME is correctly parsed on Amazon Linux 2

Tests written?

No, tested by hand

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

Copy link
Collaborator

left a comment

LGTM

@dwoz
dwoz approved these changes Mar 27, 2019
@dwoz dwoz merged commit 45d6cad into saltstack:2018.3 Mar 27, 2019
10 checks passed
10 checks passed
WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint Python lint test has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Details
@edeefelt

This comment has been minimized.

Copy link

commented Oct 21, 2019

I am seeing this issue on ami-00b882ac5193044e4 on a clean setup/install from bootstrap:

sh-4.2$ sudo salt-call --version
salt-call 2019.2.0 (Fluorine)
sh-4.2$ sudo salt-call grains.item osfinger
[ERROR ] Broken CPE_NAME format in /etc/os-release!
local:

osfinger:
Amazon Linux-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.