lib/elastic_manager/utils.rb in elastic_manager-0.3.1.pre.debug vs lib/elastic_manager/utils.rb in elastic_manager-0.3.1

- old
+ new

@@ -46,11 +46,11 @@ def delete_without_snapshot?(index) index_name = make_index_name(index) # ALARM! this can be enabled only for development logs, otherwise indices without snapshots can be deleted! if @config['settings']['indices']['_all'] && - @config['settings']['indices']['_all']['delete_without_snapshot'] + @config['settings']['indices']['_all']['delete_without_snapshot'] if true?(@config['settings']['indices']['_all']['delete_without_snapshot']) log.warn 'any index can be deleted without snapshot due global settings' return true end @@ -118,17 +118,15 @@ false end def elastic_action_with_log(action, index, *params) - # if @elastic.send(action, index, *params) - # log.info "#{index} #{action} succes" - # else - # log.error "#{index} #{action} fail" - # return false - # end - - log.info "#{index} #{action}" + if @elastic.send(action, index, *params) + log.info "#{index} #{action} succes" + else + log.error "#{index} #{action} fail" + return false + end true end def index_exist?(response)