-
Notifications
You must be signed in to change notification settings - Fork 90
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
Added a new matcher for amazon linux 2 #380
Conversation
Running into this issue. A fix being released would be really nice 👍 |
@artyomtkachenko Can you please sign your commit? |
Can you also share where and how you experienced it? While I found references on the net, I could not reproduce the issue with latest amazon 2 docker image. Related to ansible/ansible#48823 |
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.
Thank you for your first-time contribution @artyomtkachenko
I experience this and can confirm that this fix solves the problem. I just run an EC2 instance with the latest Amazon Linux 2 AMI, fully updated, then run the latest inspec with some tests, and this started crashing since a week or so. |
@chris-rock you can reproduce it with the latest |
@artyomtkachenko Is there any way we can help you? We would love to get your PR in |
Just realized I solved this in #385 ...sorry I didn't see this PR. @artyomtkachenko in order to get you credit for this (which I really want to do 😄) you can do the following:
|
Please accept my apologies Guys for a delay in a reply (all Github messages went into a SPAM folder for some reason ) and for a missing DCO. I updated my PR with the cleaner solution from @jerryaldrichiii . |
@artyomtkachenko the RegEx is still a bit off. Can you change to have that method look like: def redhatish_version(conf)
case conf
when /rawhide/i
/((\d+) \(Rawhide\))/i.match(conf)[1].downcase
when /Amazon Linux/i
/([\d\.]+)/.match(conf)[1]
when /derived from .*linux|amazon/i
/Linux ((\d+|\.)+)/i.match(conf)[1]
else
/release ([\d\.]+)/.match(conf)[1]
end
end EDIT: This is probably my fault. I'm am being too broad when I say "the RegEx". What I really mean is both the RegEx for the |
Signed-off-by: Artyom Tkachenko <offtema@gmail.com>
Sorry, my mstake. Forgot to run |
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.
Great work @artyomtkachenko!
Could you also add an exception handler ? def redhatish_version(conf)
begin
case conf
when /rawhide/i
/((\d+) \(Rawhide\))/i.match(conf)[1].downcase
when /Amazon Linux/i
/([\d\.]+)/.match(conf)[1]
when /derived from .*linux|amazon/i
/Linux ((\d+|\.)+)/i.match(conf)[1]
else
/release ([\d\.]+)/.match(conf)[1]
end
rescue => ex
raise RuntimeError, "Cannot parse redhatish OS version", ex.backtrace
end
end |
Th target of this PR is to address a problem which appeared after AWS updated naming schema for Amazon Linux 2.
More details can be found here