summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Doherty <tom.doherty@fixnetix.com>2018-04-17 13:58:17 +0100
committerTom Doherty <tom.doherty@fixnetix.com>2018-04-17 13:58:17 +0100
commitdd208b3bc741967e11d3f7b05f78f2c3c8898c64 (patch)
tree258ba1008640e100179eb7fcc50a0c49ba26eb32
parenta3a9e92568e663c8fbbbb47010929ea3eef49cab (diff)
downloadchef-dd208b3bc741967e11d3f7b05f78f2c3c8898c64.tar.gz
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