Merge pull request #700 from nathanleclaire/ec2_fixes

EC2 fixes
This commit is contained in:
Evan Hazlett 2015-03-03 17:12:02 -08:00
commit 6da2128e23
2 changed files with 9 additions and 9 deletions

View File

@ -316,8 +316,8 @@ func (d *Driver) Create() error {
return err
}
if ip != "" {
d.IPAddress = instance.IpAddress
d.IPAddress = ip
log.Debugf("Got the IP Address, it's %q", d.IPAddress)
break
}
time.Sleep(5 * time.Second)
@ -402,6 +402,8 @@ func (d *Driver) GetState() (state.State, error) {
return state.Stopping, nil
case "stopped":
return state.Stopped, nil
default:
return state.Error, nil
}
return state.None, nil
}
@ -565,10 +567,6 @@ func (d *Driver) waitForInstance() error {
time.Sleep(1 * time.Second)
}
if err := d.updateDriver(); err != nil {
return err
}
return nil
}

View File

@ -501,9 +501,11 @@ func (e *EC2) GetInstance(instanceId string) (EC2Instance, error) {
return ec2Instance, fmt.Errorf("Error unmarshalling AWS response XML: %s", err)
}
if len(unmarshalledResponse.ReservationSet) > 0 {
reservationSet := unmarshalledResponse.ReservationSet[0]
instance := reservationSet.InstancesSet[0]
return instance, nil
ec2Instance = reservationSet.InstancesSet[0]
}
return ec2Instance, nil
}
func (e *EC2) StartInstance(instanceId string) error {