mapped eucalypus invalid instance state of shutdown to terminated

This commit is contained in:
Adrian Cole 2010-09-15 13:12:30 -07:00
parent d2b145b470
commit d743f72ae5
3 changed files with 10 additions and 3 deletions

View File

@ -145,7 +145,14 @@ public abstract class BaseReservationHandler<T> extends HandlerForGeneratedReque
} else if (qName.equals("instanceId")) {
instanceId = currentOrNull();
} else if (qName.equals("name")) {
instanceState = InstanceState.fromValue(currentOrNull());
String state = currentOrNull();
if (state != null) {
// Eucalyptus
if ("shutdown".equalsIgnoreCase(state))
instanceState = InstanceState.TERMINATED;
else
instanceState = InstanceState.fromValue(state);
}
} else if (qName.equals("instanceType")) {
instanceType = currentOrNull();
} else if (qName.equals("ipAddress")) {

View File

@ -138,7 +138,7 @@ public class DescribeInstancesResponseHandlerTest extends BaseEC2HandlerTest {
contents.add(new Reservation<RunningInstance>(defaultRegion, ImmutableSet.of("default"), ImmutableSet
.of(new RunningInstance(defaultRegion, ImmutableSet.<String> of(), "0", null, "ami-h30p5im0",
"i-9slweygo", InstanceState.RUNNING, InstanceType.M1_SMALL, null, null, "nebulatanimislam",
"i-9slweygo", InstanceState.TERMINATED, InstanceType.M1_SMALL, null, null, "nebulatanimislam",
dateService.iso8601SecondsDateParse("2010-09-09T18:09:42Z"), null, null, null, "paravirtual",
null, null, "10.128.207.5", ImmutableSet.<String> of("None"), null, null, null, null, null,
RootDeviceType.INSTANCE_STORE, null, ImmutableMap.<String, EbsBlockDevice> of())), "tislam1",

View File

@ -14,7 +14,7 @@
<imageId>ami-h30p5im0</imageId>
<instanceState>
<code>1</code>
<name>running</name>
<name>shutdown</name>
</instanceState>
<keyName>nebulatanimislam</keyName>
<publicDnsName>10.128.207.5</publicDnsName>