Skip to content

Commit

Permalink
Using USE_ICE_CLI flag for parsing conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarcows committed May 25, 2016
1 parent ec3349d commit cf31d05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bddTests/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def cleanupImages(context, pause=False):
imagesFound = True
if imagesFound:
if pause:
print("Wiating 120 seconds to allow images to be deleted")
print("Waiting 120 seconds to allow images to be deleted")
time.sleep(120)
print("Finished cleaning up images.")
print
Expand Down
9 changes: 4 additions & 5 deletions image_utilities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@ if [ $IMAGE_LIMIT -gt 0 ]; then
RESULT=$?
if [ $RESULT -eq 0 ]; then
# find the number of images and check if greater than or equal to image limit
NUMBER_IMAGES=$(grep "${REGISTRY_URL}/${IMAGE_NAME}:[0-9]\+" iceretry.log | wc -l)
_USE_CF_PROCESSING=0
if [ $NUMBER_IMAGES -eq 0 ]; then
if [ "$USE_ICE_CLI" = "1" ]; then
NUMBER_IMAGES=$(grep "${REGISTRY_URL}/${IMAGE_NAME}:[0-9]\+" iceretry.log | wc -l)
else
NUMBER_IMAGES=$(grep "${REGISTRY_URL}/${IMAGE_NAME}\s\+[0-9]\+" iceretry.log | wc -l)
_USE_CF_PROCESSING=1
fi
log_and_echo "Number of images: $NUMBER_IMAGES and Image limit: $IMAGE_LIMIT"
if [ $NUMBER_IMAGES -ge $IMAGE_LIMIT ]; then
# create array of images name
if [ $_USE_CF_PROCESSING -eq 0 ]; then
if [ "$USE_ICE_CLI" = "1" ]; then
ICE_IMAGES_ARRAY=$(grep -o "${REGISTRY_URL}/${IMAGE_NAME}:[0-9]\+" iceretry.log)
else
ICE_IMAGES_ARRAY=$(grep -o "${REGISTRY_URL}/${IMAGE_NAME}\s\+[0-9]\+" iceretry.log | awk '{print $1":"$2}')
Expand Down

0 comments on commit cf31d05

Please sign in to comment.