diff options
author | sakazuki <sakazuki@gmail.com> | 2014-01-19 07:49:56 +0900 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-09-10 14:49:30 -0700 |
commit | d94700b7247c8a9c8921cea7d01f68e51f69085e (patch) | |
tree | 0b2bb8938b5d057152da5f4c06d676cb673989e9 | |
parent | c1f9cbd01c7c0b57ebfa7b90f34acad58f34f724 (diff) | |
download | chef-d94700b7247c8a9c8921cea7d01f68e51f69085e.tar.gz |
move (generate|delete)_config out of the process of running-config
-rw-r--r-- | lib/chef/provider/ifconfig.rb | 6 | ||||
-rw-r--r-- | spec/unit/provider/ifconfig_spec.rb | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/provider/ifconfig.rb b/lib/chef/provider/ifconfig.rb index c56530369b..ac52100b56 100644 --- a/lib/chef/provider/ifconfig.rb +++ b/lib/chef/provider/ifconfig.rb @@ -110,11 +110,11 @@ class Chef :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 @@ -141,12 +141,12 @@ class Chef run_command( :command => command ) - delete_config Chef::Log.info("#{@new_resource} deleted") end else Chef::Log.debug("#{@new_resource} does not exist - nothing to do") end + delete_config end def action_disable diff --git a/spec/unit/provider/ifconfig_spec.rb b/spec/unit/provider/ifconfig_spec.rb index fb8d0956d7..b09e365c65 100644 --- a/spec/unit/provider/ifconfig_spec.rb +++ b/spec/unit/provider/ifconfig_spec.rb @@ -72,7 +72,7 @@ describe Chef::Provider::Ifconfig do @provider.stub(:load_current_resource) @provider.should_not_receive(:run_command) @current_resource.inet_addr "10.0.0.1" - @provider.should_not_receive(:generate_config) + @provider.should_receive(:generate_config) @provider.run_action(:add) @new_resource.should_not be_updated @@ -123,7 +123,7 @@ describe Chef::Provider::Ifconfig do it "should not delete interface if it does not exist" do @provider.stub(:load_current_resource) @provider.should_not_receive(:run_command) - @provider.should_not_receive(:delete_config) + @provider.should_receive(:delete_config) @provider.run_action(:delete) @new_resource.should_not be_updated @@ -171,7 +171,7 @@ describe Chef::Provider::Ifconfig do @provider.stub(:load_current_resource) # This is so that nothing actually runs @provider.should_not_receive(:run_command) - @provider.should_not_receive(:delete_config) + @provider.should_receive(:delete_config) @provider.run_action(:delete) @new_resource.should_not be_updated |