ohai 13.0.0 → 13.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Rakefile +0 -3
- data/lib/ohai/plugins/eucalyptus.rb +3 -1
- data/lib/ohai/plugins/openstack.rb +3 -1
- data/lib/ohai/version.rb +1 -1
- data/spec/unit/plugins/openstack_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc03fe6ff6ba0d982a2aa2f46478ef5a9591aedb
|
4
|
+
data.tar.gz: 060eee8013d65b8225ae6d430c694b6356d9584f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50cb72595109dd4e3a7d2b0bd573dfe7eca8624a9d6ec398ec14e60b0085050f6ca9cf0438123d53b928d5f86a9696610d4931be2b1f6450d0b0f25d3a41ee65
|
7
|
+
data.tar.gz: 1d0ad0f6f97869c6875e5b71d83c2bb64f5dcf5db5e41d99c18da40e9667fe0cc3654338623ff885b76be270513775aee51ed7289e82410c0c15dfe9fe3e8d32
|
data/Gemfile
CHANGED
@@ -14,6 +14,6 @@ group :development do
|
|
14
14
|
gem "rspec-mocks", "~> 3.0"
|
15
15
|
gem "rspec-collection_matchers", "~> 1.0"
|
16
16
|
gem "rspec_junit_formatter"
|
17
|
-
gem "github_changelog_generator", git: "https://github.com/
|
17
|
+
gem "github_changelog_generator", git: "https://github.com/chef/github-changelog-generator"
|
18
18
|
gem "ipaddr_extensions"
|
19
19
|
end
|
data/Rakefile
CHANGED
@@ -30,9 +30,6 @@ begin
|
|
30
30
|
config.future_release = Ohai::VERSION
|
31
31
|
config.max_issues = 0
|
32
32
|
config.add_issues_wo_labels = false
|
33
|
-
config.enhancement_labels = "enhancement,Enhancement,New Feature,Feature".split(",")
|
34
|
-
config.bug_labels = "bug,Bug,Improvement,Upstream Bug".split(",")
|
35
|
-
config.exclude_labels = "duplicate,question,invalid,wontfix,no_changelog,Exclude From Changelog,Question,Discussion".split(",")
|
36
33
|
end
|
37
34
|
rescue LoadError
|
38
35
|
end
|
@@ -19,9 +19,11 @@
|
|
19
19
|
|
20
20
|
# eucalyptus metadata service is compatible with the ec2 service calls
|
21
21
|
require "ohai/mixin/ec2_metadata"
|
22
|
+
require "ohai/mixin/http_helper"
|
22
23
|
|
23
24
|
Ohai.plugin(:Eucalyptus) do
|
24
25
|
include Ohai::Mixin::Ec2Metadata
|
26
|
+
include Ohai::Mixin::HttpHelper
|
25
27
|
|
26
28
|
provides "eucalyptus"
|
27
29
|
depends "network/interfaces"
|
@@ -53,7 +55,7 @@ Ohai.plugin(:Eucalyptus) do
|
|
53
55
|
def looks_like_euca?
|
54
56
|
# Try non-blocking connect so we don't "block" if
|
55
57
|
# the metadata service doesn't respond
|
56
|
-
hint?("eucalyptus") || has_euca_mac? &&
|
58
|
+
hint?("eucalyptus") || has_euca_mac? && can_socket_connect?(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80)
|
57
59
|
end
|
58
60
|
|
59
61
|
collect_data do
|
@@ -17,9 +17,11 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
|
19
19
|
require "ohai/mixin/ec2_metadata"
|
20
|
+
require "ohai/mixin/http_helper"
|
20
21
|
|
21
22
|
Ohai.plugin(:Openstack) do
|
22
23
|
include Ohai::Mixin::Ec2Metadata
|
24
|
+
include Ohai::Mixin::HttpHelper
|
23
25
|
|
24
26
|
provides "openstack"
|
25
27
|
depends "dmi"
|
@@ -61,7 +63,7 @@ Ohai.plugin(:Openstack) do
|
|
61
63
|
openstack[:provider] = openstack_provider
|
62
64
|
|
63
65
|
# fetch the metadata if we can do a simple socket connect first
|
64
|
-
if
|
66
|
+
if can_socket_connect?(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80)
|
65
67
|
fetch_metadata.each do |k, v|
|
66
68
|
openstack[k] = v
|
67
69
|
end
|
data/lib/ohai/version.rb
CHANGED
@@ -37,7 +37,7 @@ describe Ohai::System, "plugin openstack" do
|
|
37
37
|
context "when DMI data is Openstack" do
|
38
38
|
context "and the metadata service is not available" do
|
39
39
|
before do
|
40
|
-
allow(plugin).to receive(:
|
40
|
+
allow(plugin).to receive(:can_socket_connect?).
|
41
41
|
with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
|
42
42
|
and_return(false)
|
43
43
|
plugin[:dmi] = { :system => { :all_records => [ { :Manufacturer => "OpenStack Foundation" } ] } }
|
@@ -57,7 +57,7 @@ describe Ohai::System, "plugin openstack" do
|
|
57
57
|
context "when running on dreamhost" do
|
58
58
|
it "sets openstack provider attribute to dreamhost" do
|
59
59
|
plugin["etc"] = { "passwd" => { "dhc-user" => {} } }
|
60
|
-
allow(plugin).to receive(:
|
60
|
+
allow(plugin).to receive(:can_socket_connect?).
|
61
61
|
with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
|
62
62
|
and_return(false)
|
63
63
|
plugin[:dmi] = { :system => { :all_records => [ { :Manufacturer => "OpenStack Foundation" } ] } }
|
@@ -69,7 +69,7 @@ describe Ohai::System, "plugin openstack" do
|
|
69
69
|
context "when the hint is present" do
|
70
70
|
context "and the metadata service is not available" do
|
71
71
|
before do
|
72
|
-
allow(plugin).to receive(:
|
72
|
+
allow(plugin).to receive(:can_socket_connect?).
|
73
73
|
with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
|
74
74
|
and_return(false)
|
75
75
|
allow(plugin).to receive(:hint?).with("openstack").and_return(true)
|
@@ -176,7 +176,7 @@ EOM
|
|
176
176
|
|
177
177
|
before do
|
178
178
|
allow(plugin).to receive(:hint?).with("openstack").and_return(true)
|
179
|
-
allow(plugin).to receive(:
|
179
|
+
allow(plugin).to receive(:can_socket_connect?).
|
180
180
|
with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
|
181
181
|
and_return(true)
|
182
182
|
|
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: 13.0.
|
4
|
+
version: 13.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: systemu
|