diff options
author | Tim Smith <tsmith@chef.io> | 2020-08-10 12:13:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-10 12:13:41 -0700 |
commit | ee0c046feaa6f686391cada52de13d34c1d57636 (patch) | |
tree | 0784d202264b31b86b3f6f59522e8249c959839c | |
parent | 5718f95897655c17f8c1b0671938ac049199b3b6 (diff) | |
parent | f2dfd4a8f3b6bf4bce6cbd60ca228ff41cf2225e (diff) | |
download | ohai-ee0c046feaa6f686391cada52de13d34c1d57636.tar.gz |
Merge pull request #1493 from chef/fix_require
Update network plugin to use ipaddr not ipaddress gem
-rw-r--r-- | lib/ohai/plugins/linux/network.rb | 4 | ||||
-rw-r--r-- | spec/unit/plugins/linux/network_spec.rb | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb index b38df361..54523e11 100644 --- a/lib/ohai/plugins/linux/network.rb +++ b/lib/ohai/plugins/linux/network.rb @@ -518,8 +518,8 @@ Ohai.plugin(:Network) do return false if default_route[:via].nil? - dest_ipaddr = IPAddress(route[:destination]) - default_route_via = IPAddress(default_route[:via]) + dest_ipaddr = IPAddr.new(route[:destination]) + default_route_via = IPAddr.new(default_route[:via]) # check if nexthop is the same address family return false if dest_ipaddr.ipv4? != default_route_via.ipv4? diff --git a/spec/unit/plugins/linux/network_spec.rb b/spec/unit/plugins/linux/network_spec.rb index 5ee364c0..978160bb 100644 --- a/spec/unit/plugins/linux/network_spec.rb +++ b/spec/unit/plugins/linux/network_spec.rb @@ -18,7 +18,6 @@ # require "spec_helper" -require "ipaddress" unless defined?(IPAddress) describe Ohai::System, "Linux Network Plugin" do let(:plugin) { get_plugin("linux/network") } |