Permalink
Browse files

switched from mash to hash to stop confusing nanite serializer

  • Loading branch information...
1 parent aa2d34a commit 0f7a2e008af4b3ff3cf1b54a8ba9c5a952bb1135 Benjamin Black committed Mar 4, 2009
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/opscode/actors/ohai_actor.rb
@@ -39,18 +39,21 @@ def initialize
def index(payload)
paths = JSON.parse(payload)
- res = Mash.new
+ res = Hash.new
paths.each do |path|
- parts = path.split("/"); parts.shift if parts[0].length == 0
+ parts = path.split("/")
+ unless parts[0].nil?
+ parts.shift if parts[0].length == 0
+ end
res[path] = ohai_walk(parts, false)
end
res
end
def ohai_walk(path, refresh)
- @@ohai.refresh_plugins(path.join('/')) if refresh
+ @@ohai.refresh_plugins("/#{path.join('/')}") if refresh
unless path[0]
- @@ohai.json_pretty_print
+ @@ohai.to_json
else
ohai_walk_r(@@ohai, path)
end

0 comments on commit 0f7a2e0

Please sign in to comment.