diff options
author | Tim Smith <tsmith@chef.io> | 2016-06-30 13:44:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-30 13:44:48 -0700 |
commit | 4e619a8a6641f3256d6e2981a3b041fa2d68799f (patch) | |
tree | 1c381f822d60a3b2f342839168a8d3daa1cfd206 | |
parent | bcff227735417f78184ddad70771d369d62bbc5d (diff) | |
parent | ce2d661ce7b1aa13f7d2bc6cacb4e1b1f0785e73 (diff) | |
download | ohai-4e619a8a6641f3256d6e2981a3b041fa2d68799f.tar.gz |
Merge pull request #836 from chef/time
Move timezone value under time
-rw-r--r-- | lib/ohai/plugins/timezone.rb | 5 | ||||
-rw-r--r-- | spec/unit/plugins/timezone_spec.rb | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/ohai/plugins/timezone.rb b/lib/ohai/plugins/timezone.rb index fb35987d..26a63e42 100644 --- a/lib/ohai/plugins/timezone.rb +++ b/lib/ohai/plugins/timezone.rb @@ -15,9 +15,10 @@ # limitations under the License. Ohai.plugin(:Timezone) do - provides "timezone" + provides "time/timezone" collect_data(:default) do - timezone Time.now.getlocal.zone + time Mash.new unless time + time[:timezone] = Time.now.getlocal.zone end end diff --git a/spec/unit/plugins/timezone_spec.rb b/spec/unit/plugins/timezone_spec.rb index 770dc838..62fcb0ef 100644 --- a/spec/unit/plugins/timezone_spec.rb +++ b/spec/unit/plugins/timezone_spec.rb @@ -25,6 +25,6 @@ describe Ohai::System, "timezone plugin" do it "should get the local timezone" do @plugin.run - expect(@plugin["timezone"]).to eq("ZZZ") + expect(@plugin["time"]["timezone"]).to eq("ZZZ") end end |