summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2016-11-29 14:48:24 -0800
committerTim Smith <tsmith@chef.io>2016-11-29 14:48:24 -0800
commit921d51159f5d7f901a91c13d1cf969485491c091 (patch)
tree1a3ba38c8e29dfeeb66eb5d722e2373392cc393d
parent72683c9ce8b3542cc72267caf0869f6424aaae71 (diff)
downloadohai-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.rb4
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