Skip to content

Commit

Permalink
Adds a clear config
Browse files Browse the repository at this point in the history
  • Loading branch information
spuder committed Sep 2, 2015
1 parent 108db50 commit fa8f30a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@
Chef::Log.info('IIS Config command run')
new_resource.updated_by_last_action(true)
end

action :clear do
cmd = "#{appcmd(node)} clear config #{new_resource.cfg_cmd}"

This comment has been minimized.

Copy link
@EasyAsABC123

EasyAsABC123 Sep 2, 2015

Create a function that does all of these steps...where you pass it the word set or clear

If that doesn't make sense I definitely can try to explain better

Chef::Log.debug(cmd)
shell_out!(cmd, :returns => new_resource.returns)
Chef::Log.info('IIS Config command run')
new_resource.updated_by_last_action(true)
end
2 changes: 1 addition & 1 deletion resources/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# limitations under the License.
#

actions :config
actions :config, :clear
default_action :config

attribute :cfg_cmd, kind_of: String, name_attribute: true
Expand Down

0 comments on commit fa8f30a

Please sign in to comment.