summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2018-04-19 12:51:23 +0100
committerGitHub <noreply@github.com>2018-04-19 12:51:23 +0100
commit426d30762bdeb9d5a64d8e64ea3454a523e2f6af (patch)
treea97fca745b14a842bd15d4d24a7b06896e268d0e
parentb6ee427ea8dae1eaaf3bbd0e96559d983bb9f908 (diff)
parent9590459424d4eec749fc6bcd0075fc0e361898a0 (diff)
downloadchef-426d30762bdeb9d5a64d8e64ea3454a523e2f6af.tar.gz
Merge pull request #7162 from tomdoherty/td/use-dev-with-route-metric
Some options, i.e. metric, require specifying dev
-rw-r--r--lib/chef/provider/route.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/provider/route.rb b/lib/chef/provider/route.rb
index ed1f1f4c4d..b23d0307cc 100644
--- a/lib/chef/provider/route.rb
+++ b/lib/chef/provider/route.rb
@@ -174,7 +174,7 @@ class Chef
conf[dev] = "" if conf[dev].nil?
case @action
when :add
- conf[dev] << config_file_contents(:add, comment: resource.comment, target: resource.target, metric: resource.metric, netmask: resource.netmask, gateway: resource.gateway) if resource.action == [:add]
+ conf[dev] << config_file_contents(:add, comment: resource.comment, device: resource.device, target: resource.target, metric: resource.metric, netmask: resource.netmask, gateway: resource.gateway) if resource.action == [:add]
when :delete
# need to do this for the case when the last route on an int
# is removed
@@ -236,6 +236,7 @@ class Chef
content << (options[:target]).to_s
content << "/#{MASK[options[:netmask].to_s]}" if options[:netmask]
content << " via #{options[:gateway]}" if options[:gateway]
+ content << " dev #{options[:device]}" if options[:device]
content << " metric #{options[:metric]}" if options[:metric]
content << "\n"
end