summaryrefslogtreecommitdiff
path: root/lib/chef/provider/ifconfig.rb
diff options
context:
space:
mode:
authorkaustubh-d <kausubh@clogeny.com>2013-07-16 11:03:05 -0700
committeradamedx <adamed@opscode.com>2013-07-23 10:35:31 -0700
commit7b96670bb5f39fad6f611754f8926ec5e48389ca (patch)
tree01c5d82b048ee220c0557d20f4d4d76c11ad2b7b /lib/chef/provider/ifconfig.rb
parent37a8f6300be963a5713794330ef4e9cd2db4223a (diff)
downloadchef-7b96670bb5f39fad6f611754f8926ec5e48389ca.tar.gz
ifconfig - generate configs only when updating interface.
Diffstat (limited to 'lib/chef/provider/ifconfig.rb')
-rw-r--r--lib/chef/provider/ifconfig.rb30
1 files changed, 14 insertions, 16 deletions
diff --git a/lib/chef/provider/ifconfig.rb b/lib/chef/provider/ifconfig.rb
index d55e792ae7..6c01ac89a0 100644
--- a/lib/chef/provider/ifconfig.rb
+++ b/lib/chef/provider/ifconfig.rb
@@ -104,17 +104,16 @@ class Chef
unless @current_resource.inet_addr
unless @new_resource.device == "lo"
command = add_command
- end
- converge_by ("run #{command} to add #{@new_resource}") do
- run_command(
- :command => command
- )
- Chef::Log.info("#{@new_resource} added")
+ converge_by ("run #{command} to add #{@new_resource}") do
+ run_command(
+ :command => command
+ )
+ Chef::Log.info("#{@new_resource} added")
+ # Write out the config files
+ generate_config
+ end
end
end
-
- # Write out the config files
- generate_config
end
def action_enable
@@ -126,13 +125,12 @@ class Chef
command << " netmask #{@new_resource.mask}" if @new_resource.mask
command << " metric #{@new_resource.metric}" if @new_resource.metric
command << " mtu #{@new_resource.mtu}" if @new_resource.mtu
- end
-
- converge_by ("run #{command} to enable #{@new_resource}") do
- run_command(
- :command => command
- )
- Chef::Log.info("#{@new_resource} enabled")
+ converge_by ("run #{command} to enable #{@new_resource}") do
+ run_command(
+ :command => command
+ )
+ Chef::Log.info("#{@new_resource} enabled")
+ end
end
end
end