Skip to content

Commit 2689e8d

Browse files
committed
Merge pull request #223 from chef-cookbooks/iis_root_fix
Unable to add_default_documents using iis_root
2 parents e8c4aa5 + 991d671 commit 2689e8d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libraries/processors.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ module IIS
2424
# Contains functions that are used throughout this cookbook
2525
module Processors
2626
def default_documents(default_document, default_documents_enabled, add = true, remove = true, specifier = '')
27-
cmd = get_default_documents_command specifier
27+
cmd = shell_out! get_default_documents_command specifier
2828
return unless cmd.stderr.empty?
2929
xml = cmd.stdout
30-
doc = Document.new xml
30+
doc = REXML::Document.new xml
3131

3232
is_new_default_documents_enabled = new_value?(doc.root, 'CONFIG/system.webServer-defaultDocument/@enabled', default_documents_enabled.to_s)
33-
current_default_documents = XPath.match(doc.root, 'CONFIG/system.webServer-defaultDocument/files/add/@value').map(&:value)
33+
current_default_documents = REXML::XPath.match(doc.root, 'CONFIG/system.webServer-defaultDocument/files/add/@value').map(&:value)
3434
cmd = default_documents_command specifier
3535

3636
if is_new_default_documents_enabled
@@ -66,10 +66,10 @@ def mime_maps(new_resource_mime_maps, add = true, remove = true, specifier = '')
6666
cmd = shell_out get_mime_map_command specifier
6767
return unless cmd.stderr.empty?
6868
xml = cmd.stdout
69-
doc = Document.new xml
70-
current_mime_maps = XPath.match(doc.root, 'CONFIG/system.webServer-staticContent/mimeMap').map { |x| "fileExtension='#{x.attribute 'fileExtension'}',mimeType='#{x.attribute 'mimeType'}'" }
69+
doc = REXML::Document.new xml
70+
current_mime_maps = REXML::XPath.match(doc.root, 'CONFIG/system.webServer-staticContent/mimeMap').map { |x| "fileExtension='#{x.attribute 'fileExtension'}',mimeType='#{x.attribute 'mimeType'}'" }
7171

72-
cmd = set_mime_map_command specifier
72+
cmd = mime_map_command specifier
7373

7474
if add || remove
7575
new_resource_mime_maps.each do |mime_map|

0 commit comments

Comments
 (0)