Skip to content

Commit

Permalink
bug 1656086. code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcantrill authored and openshift-cherrypick-robot committed Dec 14, 2018
1 parent 6d5d0b7 commit 710f6e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Binary file not shown.
Expand Up @@ -20,7 +20,7 @@
# https://bugzilla.redhat.com/show_bug.cgi?id=1656086
set -e

if [ -n "${SDEBUG:-}" ] ; then
if [ -n "${DEBUG:-}" ] ; then
set -x
fi

Expand Down Expand Up @@ -54,14 +54,14 @@ except:
'
}

response=$(es_util --query='.kibana*/index-pattern/_search?_count?q=title:$TITLE$' )
response=$(es_util --query='.kibana*/index-pattern/_count?q=title:$TITLE$')
debug "Initial response: $response"

tot_docs=$(get_count "$response")
info "Found ${tot_docs} index-patterns to remove"

response=$(es_util --query='.kibana*/index-pattern/_delete_by_query' -d '{"query":{"match":{"title":"$TITLE$"}}}')
if [ $(get_deleted $respose) -ne ${tot_docs} ] ; then
if [ $(get_deleted $response) -ne ${tot_docs} ] ; then
error "Error deleting index-patterns: $response"
fi

Expand Down
4 changes: 2 additions & 2 deletions test/0510-bz1656086-remove-index-patterns-with-bad-title
Expand Up @@ -86,7 +86,7 @@ sleep 5
remaining=$($cmd -- es_util --query='.kibana*/index-pattern/_count?q=title:$TITLE$' | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["count"]')

if [ $remaining -ne 0 ] ; then
os::log::error Found index-patterns in response that had 'title' equal to '$TITLE$'
os::log::error "$($cmd -- es_util --query='.kibana*/index-pattern/_search?pretty&_source=false&q=title:$TITLE$')"
os::log::error Found $remaining index-patterns in response that had 'title' equal to '$TITLE$'
$cmd -- es_util --query='.kibana*/index-pattern/_search?pretty&_source=false&q=title:$TITLE$' 2>&1 | artifact_out
exit 1
fi

0 comments on commit 710f6e7

Please sign in to comment.