mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
bugfix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package aws
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
@@ -221,6 +222,10 @@ func (self *SRegion) DissociateEip(eipId string, instanceId string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
if eip.InstanceId != instanceId {
|
||||
return fmt.Errorf("eip %s associate with another instance %s", eipId, eip.InstanceId)
|
||||
}
|
||||
|
||||
params := &ec2.DisassociateAddressInput{}
|
||||
params.SetAssociationId(eip.AssociationId)
|
||||
_, err = self.ec2Client.DisassociateAddress(params)
|
||||
|
||||
Reference in New Issue
Block a user