ohai 7.0.0 → 7.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01efe8796a57251ebbcf16774f01e20ca60fa7e8
4
- data.tar.gz: fa4468d7b1b40b8dd2d4ae8bc3210e468017e8ad
3
+ metadata.gz: d5000ad010af950e34ca83e38bc47a3ea02b15c5
4
+ data.tar.gz: 9b606e4475a7a3fcdd35d315fa121a19f1df43f5
5
5
  SHA512:
6
- metadata.gz: d88c7d2ca3c573f6b7ea4e0f62e59a5457f413908eab0b6d1dcb3e3226a4f112697b67a38a9bd155689d29f6d73344ecadcabb362da04962bdf7735991935ba8
7
- data.tar.gz: 2751ea3765a1ab857ab6a966d926217209ecf34add0ab32eef44578495978365c653cefcefe3d143b83958cbbe354f8b0ba59659c1a2139a0571bdbb3af0fffc
6
+ metadata.gz: 6a070ccd2fe321b8fdc9f76fbea5917dc77262d959c8e44ac911bafa7170a95282e0d11af545e1a16d813460323dbf6f4829af93cbb4e4197fc65637f4acf319
7
+ data.tar.gz: 58dfa08849444ad98bea48f0172c9082237017406ec41466b556e278f915c50c2f5df7d3032df3e06e42b318eaf23da552147585e001560319a11d83c177b869
@@ -83,6 +83,13 @@ module Ohai
83
83
  @runner.run_plugin(v6plugin)
84
84
  end
85
85
 
86
+ # Users who are migrating from ohai 6 may give one or more Ohai 6 plugin
87
+ # names as the +attribute_filter+. In this case we return early because
88
+ # the v7 plugin provides map will not have an entry for this plugin.
89
+ if attribute_filter and Array(attribute_filter).all? {|filter_item| have_v6_plugin?(filter_item) }
90
+ return true
91
+ end
92
+
86
93
  # Then run all the version 7 plugins
87
94
  begin
88
95
  @provides_map.all_plugins(attribute_filter).each { |plugin|
@@ -94,6 +101,10 @@ module Ohai
94
101
  end
95
102
  end
96
103
 
104
+ def have_v6_plugin?(name)
105
+ @v6_dependency_solver.values.any? {|v6plugin| v6plugin.name == name }
106
+ end
107
+
97
108
  def pathify_v6_plugin(plugin_name)
98
109
  path_components = plugin_name.split("::")
99
110
  File.join(path_components) + ".rb"
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = '7.0.0'
21
+ VERSION = '7.0.2'
22
22
  end
@@ -517,6 +517,29 @@ EOF
517
517
  end
518
518
 
519
519
  describe "when Chef OHAI resource executes :reload action" do
520
+
521
+ when_plugins_directory "contains a v6 plugin" do
522
+ with_plugin("a_v6plugin.rb", <<-E)
523
+ plugin_data Mash.new
524
+ plugin_data[:foo] = :bar
525
+ E
526
+
527
+ before do
528
+ @original_config = Ohai::Config[:plugin_path]
529
+ Ohai::Config[:plugin_path] = [ path_to(".") ]
530
+ end
531
+
532
+ after do
533
+ Ohai::Config[:plugin_path] = @original_config
534
+ end
535
+
536
+ it "reloads only the v6 plugin when given a specific plugin to load" do
537
+ ohai.all_plugins
538
+ lambda { ohai.all_plugins("a_v6plugin") }.should_not raise_error
539
+ end
540
+
541
+ end
542
+
520
543
  when_plugins_directory "contains a random plugin" do
521
544
  with_plugin("random.rb", <<-E)
522
545
  Ohai.plugin(:Random) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohai
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 7.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-08 00:00:00.000000000 Z
11
+ date: 2014-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types