summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2016-06-30 13:44:48 -0700
committerGitHub <noreply@github.com>2016-06-30 13:44:48 -0700
commit4e619a8a6641f3256d6e2981a3b041fa2d68799f (patch)
tree1c381f822d60a3b2f342839168a8d3daa1cfd206
parentbcff227735417f78184ddad70771d369d62bbc5d (diff)
parentce2d661ce7b1aa13f7d2bc6cacb4e1b1f0785e73 (diff)
downloadohai-4e619a8a6641f3256d6e2981a3b041fa2d68799f.tar.gz
Merge pull request #836 from chef/time
Move timezone value under time
-rw-r--r--lib/ohai/plugins/timezone.rb5
-rw-r--r--spec/unit/plugins/timezone_spec.rb2
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