Skip to content

Commit

Permalink
fix bug with setting no_managed_code
Browse files Browse the repository at this point in the history
Signed-off-by jmschu02@gmail.com

**Description**
had to recreate
Fixes a bug in iis_pool that causes an issue with resetting to no_managed_code runtime versions

**Issues Resolved**
#395

**Check List**
  All tests pass. See https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD
  New functionality includes testing.
  New functionality has been documented in the README if applicable
  All commits have been signed for the Developer Certificate of Origin. See https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD
  • Loading branch information
EasyAsABC123 committed Sep 29, 2023
1 parent 32173da commit c909d28
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion resources/pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,12 @@ def configure
end

if new_resource.no_managed_code
converge_if_changed :runtime_version do
Chef::Log.warn("ran into no managed runtime #{new_resource.runtime_version} | #{current_resource.runtime_version}")
if new_resource.runtime_version != current_resource.runtime_version
# temporary fix for issue with converge_if_changed should be able to be removed when we get to chef 14
# converge_if_changed :runtime_version do
cmd << configure_application_pool('managedRuntimeVersion:')
Chef::Log.warn("ran into no managed runtime #{cmd}")
end
else
converge_if_changed :runtime_version do
Expand Down
12 changes: 12 additions & 0 deletions test/cookbooks/test/recipes/pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
action [:add, :config, :stop]
end

iis_pool 'test_no_managed_code' do
no_managed_code false
pipeline_mode :Integrated
action [:add, :config, :start]
end

iis_pool 'testapppool' do
thirty_two_bit false
runtime_version '4.0'
Expand All @@ -53,6 +59,12 @@
action [:add, :config]
end

iis_pool 'test_no_managed_code' do
no_managed_code true
pipeline_mode :Classic
action [:add, :config, :start]
end

iis_pool 'passwordwithentityapppool' do
thirty_two_bit false
runtime_version '4.0'
Expand Down
7 changes: 7 additions & 0 deletions test/integration/pool/controls/pool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
its('identity_type') { should eq 'NetworkService' }
end

describe iis_pool('test_no_managed_code') do
it { should exist }
it { should be_running }
its('managed_pipeline_mode') { should eq 'Classic' }
its('managed_runtime_version') { should eq '' }
end

describe iis_pool('Process Model Cleanup') do
it { should exist }
it { should be_running }
Expand Down

0 comments on commit c909d28

Please sign in to comment.