221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
|
# File 'lib/collins_shell/asset.rb', line 221
def set_status
status = options.status
state = options.state
reason = options.reason
if status.nil? && state.nil? then
raise ::Collins::ExpectationFailedError.new("set_status requires either a status or a state")
end
batch_selector_operation Hash[
:remote => options.remote,
:operation => "set_status",
:size => options["size"],
:success_message => proc {|asset| "Set status to #{status} on #{asset.tag}"},
:error_message => proc{|asset| "Setting status on #{asset.tag}"},
:confirmation_message => proc do |assets|
"You are about to set status to #{status} on #{assets.length} hosts. ARE YOU SURE?"
end
] do |client,asset|
client.set_status!(asset, :reason => reason, :status => status, :state => state)
end
end
|