lib/elastic_manager/utils.rb in elastic_manager-0.3.0 vs lib/elastic_manager/utils.rb in elastic_manager-0.3.1.pre.debug
- old
+ new
@@ -44,10 +44,20 @@
end
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']
+
+ if true?(@config['settings']['indices']['_all']['delete_without_snapshot'])
+ log.warn 'any index can be deleted without snapshot due global settings'
+ return true
+ end
+ end
+
if @config['settings']['indices'][index_name] &&
@config['settings']['indices'][index_name]['delete_without_snapshot']
if true?(@config['settings']['indices'][index_name]['delete_without_snapshot'])
log.warn "#{index_name} index can be deleted without snapshot"
@@ -108,15 +118,17 @@
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
+ # if @elastic.send(action, index, *params)
+ # log.info "#{index} #{action} succes"
+ # else
+ # log.error "#{index} #{action} fail"
+ # return false
+ # end
+
+ log.info "#{index} #{action}"
true
end
def index_exist?(response)