do not warn for missing gateway IPs #290

Merged
merged 4 commits into from Jun 18, 2014

4 participants

@hollow

When using a /32 address with a point-to-point gateway, you can either
use iproute2's peer option in which case ohai detects the ipaddress
correctly. Alternatively one can configure the /32 address on the
network and setup a static route to the gateway:

$ ip a
3: lxc0: mtu 1500 qdisc noqueue state UP
link/ether 00:1e:8c:f4:f0:b1 brd ff:ff:ff:ff:ff:ff
inet 1.2.3.4/32 scope global lxc0

$ ip r
default via 1.2.3.1 dev lxc0
1.2.3.1 dev lxc0 scope link

Using this configuration ohai does the right thing but logs a warning.
This patch simply converts the log line to debug to hide this.

Benedikt Boehm do not warn for missing gateway IPs
When using a /32 address with a point-to-point gateway, you can either
use iproute2's peer option in which case ohai detects the ipaddress
correctly. Alternatively one can configure the /32 address on the
network and setup a static route to the gateway:

$ ip a
3: lxc0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 00:1e:8c:f4:f0:b1 brd ff:ff:ff:ff:ff:ff
    inet 1.2.3.4/32 scope global lxc0

$ ip r
default via 5.9.41.225 dev lxc0
5.9.41.225 dev lxc0  scope link

Using this configuration ohai does the right thing but logs a warning.
This patch simply converts the log line to debug to hide this.
6f19927
@hollow

FYI: i already signed the CLA

@btm
Chef Software, Inc. member
btm commented Mar 5, 2014

Did you open a JIRA ticket for this?

Will need to update the unit test too, travis is showing it is broken by this change:

  1) Ohai::System Network Plugin with linux when the linux::network plugin hasn't set any of {ip,ip6,mac}address attributes conflicting results from the linux::network plugin default interface doesn't match the default_gateway warns about this conflict
     Failure/Error: Ohai::Log.should_receive(:warn).with(/^\[inet\] no ipaddress\/mask on eth1/).once
       (<Ohai::Log (class)>).warn(/^\[inet\] no ipaddress\/mask on eth1/)
           expected: 1 time with arguments: (/^\[inet\] no ipaddress\/mask on eth1/)
           received: 0 times with arguments: (/^\[inet\] no ipaddress\/mask on eth1/)
@btm
Chef Software, Inc. member
btm commented May 6, 2014

@hollow I do see you on the approved contributor list as 610. We do need the unit test fixed before we could merge this.

http://docs.opscode.com/community_contributions.html

@sersut
Chef Software, Inc. member

@hollow let us know if you need help with specs for this one.

@hollow

@sersut i've fixed/removed the specs

@sersut sersut commented on an outdated diff Jun 2, 2014
spec/unit/plugins/network_spec.rb
@@ -376,12 +376,6 @@ def it_does_not_fail
@plugin["macaddress"].should == "00:16:3E:2F:36:80"
@plugin["ip6address"].should == "3ffe:1111:3333::1"
end
-
- it "warns about this conflict" do
- Ohai::Log.should_receive(:warn).with(/^\[inet\] no ipaddress\/mask on eth1/).once
@sersut
Chef Software, Inc. member
sersut added a note Jun 2, 2014

I think we should convert these specs to check for :debug rather than removing them.

Thanks for the update. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@sersut sersut added Ready for Merge and removed Attack List labels Jun 2, 2014
@mcquin mcquin merged commit bd80c05 into chef:master Jun 18, 2014

1 check passed

Details continuous-integration/travis-ci The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment