Skip to content

Commit

Permalink
fb_networkd: Validate given IP addresses - 100%
Browse files Browse the repository at this point in the history
Differential Revision: D57674868

fbshipit-source-id: d0c82ffbedb9908684f7a7a26916ef773e833a40
  • Loading branch information
joshuamiller01 authored and facebook-github-bot committed May 22, 2024
1 parent 61bcc51 commit 46ccd8a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion cookbooks/fb_networkd/resources/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
# resources for the different networkd units and move this validation to those
# custom resources
def validate_network_addresses(conf)
return if !node.in_shard?(0)
conf.dig('config', 'Network', 'Address')&.each do |ip|
::IPAddr.new(ip)
rescue ::IPAddr::Error
Expand Down
5 changes: 0 additions & 5 deletions cookbooks/fb_networkd/spec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
:step_into => ['fb_networkd', 'fb_helpers_gated_template'],
) do |node|
allow(node).to receive(:systemd?).and_return(true)
allow(node).to receive(:in_shard?).and_return(true)

# These enable the fb_helpers_gated_template resources
allow(node).to receive(:interface_change_allowed?).and_return(true)
Expand Down Expand Up @@ -131,7 +130,6 @@
:step_into => ['fb_networkd', 'fb_helpers_gated_template'],
) do |node|
allow(node).to receive(:systemd?).and_return(true)
allow(node).to receive(:in_shard?).and_return(true)

# These enable the fb_helpers_gated_template resources
allow(node).to receive(:interface_change_allowed?).and_return(true)
Expand Down Expand Up @@ -162,7 +160,6 @@
:step_into => ['fb_networkd', 'fb_helpers_gated_template'],
) do |node|
allow(node).to receive(:systemd?).and_return(true)
allow(node).to receive(:in_shard?).and_return(true)

# These enable the fb_helpers_gated_template resources
allow(node).to receive(:interface_change_allowed?).and_return(true)
Expand Down Expand Up @@ -191,7 +188,6 @@
:step_into => ['fb_networkd', 'fb_helpers_gated_template'],
) do |node|
allow(node).to receive(:systemd?).and_return(true)
allow(node).to receive(:in_shard?).and_return(true)

# These enable the fb_helpers_gated_template resources
allow(node).to receive(:interface_change_allowed?).and_return(true)
Expand Down Expand Up @@ -220,7 +216,6 @@
:step_into => ['fb_networkd', 'fb_helpers_gated_template'],
) do |node|
allow(node).to receive(:systemd?).and_return(true)
allow(node).to receive(:in_shard?).and_return(true)

# These enable the fb_helpers_gated_template resources
allow(node).to receive(:interface_change_allowed?).and_return(true)
Expand Down

0 comments on commit 46ccd8a

Please sign in to comment.