Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Fixing bad status checking logic (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
fieldju authored Apr 1, 2017
1 parent 10d1d38 commit cfaf163
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

group=com.nike
artifactId=cerberus-lifecycle-cli
version=0.16.2
version=0.16.3
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.amazonaws.services.cloudformation.model.StackStatus;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;
import com.nike.cerberus.ConfigConstants;
import com.nike.cerberus.command.core.UpdateStackCommand;
Expand All @@ -44,6 +45,7 @@
import javax.inject.Inject;
import javax.inject.Named;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.amazonaws.services.cloudformation.model.StackStatus.*;
Expand Down Expand Up @@ -128,8 +130,8 @@ public void run(final UpdateStackCommand command) {
UPDATE_ROLLBACK_FAILED
));

if (endStatus != UPDATE_COMPLETE || endStatus != UPDATE_COMPLETE_CLEANUP_IN_PROGRESS) {
final String errorMessage = String.format("Unexpected end status: %s", endStatus.name());
if (! ImmutableList.of(UPDATE_COMPLETE, UPDATE_COMPLETE_CLEANUP_IN_PROGRESS).contains(endStatus)) {
final String errorMessage = String.format("CloudFormation reports that updating the stack was not successful. end status: %s", endStatus.name());
logger.error(errorMessage);

throw new UnexpectedCloudFormationStatusException(errorMessage);
Expand Down

0 comments on commit cfaf163

Please sign in to comment.