diff options
author | Tim Smith <tsmith@chef.io> | 2016-11-29 14:48:24 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2016-11-29 14:48:24 -0800 |
commit | 921d51159f5d7f901a91c13d1cf969485491c091 (patch) | |
tree | 1a3ba38c8e29dfeeb66eb5d722e2373392cc393d | |
parent | 72683c9ce8b3542cc72267caf0869f6424aaae71 (diff) | |
download | ohai-921d51159f5d7f901a91c13d1cf969485491c091.tar.gz |
Use a regex vs. a split that didn’t seem to work
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/ohai/plugins/joyent.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/ohai/plugins/joyent.rb b/lib/ohai/plugins/joyent.rb index 00127865..118ea907 100644 --- a/lib/ohai/plugins/joyent.rb +++ b/lib/ohai/plugins/joyent.rb @@ -36,9 +36,7 @@ Ohai.plugin(:Joyent) do def collect_pkgsrc data = ::File.read("/opt/local/etc/pkg_install.conf") rescue nil if data - data.strip.split("=", 2).last - else - nil + /PKG_PATH=(.*)/.match(data)[1] rescue nil end end |