Skip to content
Permalink
Browse files
Merge pull request #184 from ClusterHQ/ensure-instance-shutdown-set
JENKINS-26371 - Ensure instance initiated shutdown behaviour is consistent with stopOnTerminate flag
  • Loading branch information
Francis Upton IV committed Mar 31, 2016
2 parents 0f4f391 + ce95f41 commit 57b7e7932d504a9152501a9dfaeaf08003631121
Showing 1 changed file with 8 additions and 0 deletions.
@@ -456,6 +456,14 @@ private EC2AbstractSlave provisionOndemand(TaskListener listener, boolean allowC
setupCustomDeviceMapping(riRequest);
}

if(stopOnTerminate){
riRequest.setInstanceInitiatedShutdownBehavior(ShutdownBehavior.Stop);
logProvisionInfo(logger, "Setting Instance Initiated Shutdown Behavior : ShutdownBehavior.Stop");
}else{
riRequest.setInstanceInitiatedShutdownBehavior(ShutdownBehavior.Terminate);
logProvisionInfo(logger, "Setting Instance Initiated Shutdown Behavior : ShutdownBehavior.Terminate");
}

List<Filter> diFilters = new ArrayList<Filter>();
diFilters.add(new Filter("image-id").withValues(ami));

0 comments on commit 57b7e79

Please sign in to comment.