File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 206
206
end
207
207
208
208
action :start do
209
- if !current_resource . runtime_version
209
+ if !current_resource . runtime_version && ! running
210
210
converge_by "Started Application Pool \" #{ new_resource } \" " do
211
- shell_out! ( "#{ appcmd ( node ) } start apppool \" #{ new_resource . name } \" " ) unless new_resource . running
211
+ shell_out! ( "#{ appcmd ( node ) } start apppool \" #{ new_resource . name } \" " )
212
212
end
213
213
else
214
214
Chef ::Log . debug ( "#{ new_resource } already running - nothing to do" )
215
215
end
216
216
end
217
217
218
218
action :stop do
219
- if current_resource . runtime_version
219
+ if current_resource . runtime_version && running
220
220
converge_by "Stopped Application Pool \" #{ new_resource } \" " do
221
221
shell_out! ( "#{ appcmd ( node ) } stop apppool \" #{ new_resource . name } \" " )
222
222
end
238
238
action :recycle do
239
239
if current_resource . runtime_version
240
240
converge_by "Recycled Application Pool \" #{ new_resource } \" " do
241
- shell_out! ( "#{ appcmd ( node ) } recycle APPPOOL \" #{ new_resource . name } \" " )
241
+ shell_out! ( "#{ appcmd ( node ) } recycle APPPOOL \" #{ new_resource . name } \" " ) if running
242
242
end
243
243
end
244
244
end
Original file line number Diff line number Diff line change 26
26
iis_pool 'myAppPool_v1_1' do
27
27
runtime_version '2.0'
28
28
pipeline_mode :Classic
29
- action [ :add , :config ]
29
+ action [ :add , :config , :stop ]
30
30
end
31
31
32
32
iis_pool 'testapppool' do
Original file line number Diff line number Diff line change 12
12
13
13
describe iis_pool ( 'myAppPool_v1_1' ) do
14
14
it { should exist }
15
- it { should be_running }
15
+ its ( 'state' ) { should eq 'Stopped' }
16
16
its ( 'managed_runtime_version' ) { should eq 'v2.0' }
17
17
it { should have_name ( 'myAppPool_v1_1' ) }
18
18
it { should have_queue_length ( 1000 ) }
Original file line number Diff line number Diff line change @@ -110,7 +110,6 @@ def has_name?(pool_name)
110
110
end
111
111
112
112
def has_queue_length? ( queue_length )
113
- Log . info ( iis_pool )
114
113
iis_pool . nil? ? false : iis_pool [ :queue_length ] == queue_length
115
114
end
116
115
@@ -160,7 +159,6 @@ def iis_pool(pool_name)
160
159
pool_cpu = JSON . parse ( cmd_cpu . stdout )
161
160
pool_worker_processes = JSON . parse ( cmd_worker_processes . stdout )
162
161
rescue JSON ::ParserError => _e
163
- Log . info ( cmd . stderr )
164
162
return { }
165
163
end
166
164
You can’t perform that action at this time.
0 commit comments