-
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
Kali Linux platform detection support #556
Conversation
Hello mattray! Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
FWIW I installed Chef via the .DEB on the Kali box and ohai works just fine. They will both report the same platform, family and version after 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.
This is looks OK to me.... one wonders if we should one day add a set of Kitchen platform detection tests or something.
Validated that this works with an aarch64 Kali install too |
plat.name("kali").title("Kali Linux").in_family("debian") | ||
.detect do | ||
if linux_os_release && linux_os_release["ID"].eql?("kali") | ||
@platform[:release] = linux_os_release["VERSION"] |
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.
This is 3 calls to linux_os_release
... please use local variables to make it only 1.
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.
Updated in latest PR
@@ -76,6 +76,13 @@ def self.load | |||
true | |||
end | |||
end | |||
plat.name("kali").title("Kali Linux").in_family("debian") | |||
.detect do | |||
if linux_os_release && linux_os_release["ID"].eql?("kali") |
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.
eql?
is never the right comparator to call and can't succeed in the wild. Please stick with ==
.
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.
Updated in latest PR.
@@ -202,7 +216,7 @@ def debian_scan(id, version) | |||
|
|||
describe "/etc/os-release" do | |||
describe "when not on a wrlinux build" do | |||
it "fail back to genaric linux" do | |||
it "fail back to generic linux" do |
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.
Hah! I just did this too.
Signed-off-by: Matt Ray <github@mattray.dev>
…eview Followup on code review feedback Signed-off-by: Matt Ray <github@mattray.dev>
Code Climate has analyzed commit 4f36f12 and detected 4 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Add support for detecting Kali Linux
Signed-off-by: Matt Ray github@mattray.dev