lib/splash/sequences.rb in prometheus-splash-0.8.4 vs lib/splash/sequences.rb in prometheus-splash-0.8.5
- old
+ new
@@ -23,15 +23,20 @@
if list.include? name then
seq_options = (list[name][:options].nil?)? {} : list[name][:options]
list[name][:definition].each do |step|
log.info "STEP : #{step[:step]}",session
if step[:on_host].nil? then
- command = CommandWrapper::new(step[:command].to_s)
+ if get_config.commands.select{|cmd| cmd[:name] == step[:command]}.count > 0 then
+ command = CommandWrapper::new(step[:command].to_s)
step[:callback] = true if step[:callback].nil?
step[:trace] = true if step[:trace].nil?
step[:notify] = true if step[:notify].nil?
step[:session] = session
acase = command.call_and_notify step
+ else
+ log.error "Commmand #{step[:command]} not found, for STEP : #{step[:step]}", session
+ acase = splash_return :not_found
+ end
else
log.info "Remote execution of #{step[:command]} on #{step[:on_host]}", session
begin
transport = get_default_client
if transport.class == Hash and transport.include? :case then