From 4a1ad108e466f94d91dbae210104d4c107ec3b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Wed, 5 Dec 2018 13:31:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=88=A0=E9=99=A4=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E6=97=B6=EF=BC=8C=E4=BA=91=E7=AB=AFeip=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E5=88=A0=E9=99=A4=E6=97=B6=EF=BC=8C=E6=97=A0=E9=99=90?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/compute/tasks/eip_dissociate_task.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/compute/tasks/eip_dissociate_task.go b/pkg/compute/tasks/eip_dissociate_task.go index 30658ead59..8df38e6d80 100644 --- a/pkg/compute/tasks/eip_dissociate_task.go +++ b/pkg/compute/tasks/eip_dissociate_task.go @@ -1,14 +1,14 @@ package tasks - import ( - "fmt" "context" + "fmt" "yunion.io/x/jsonutils" "yunion.io/x/onecloud/pkg/cloudcommon/db" "yunion.io/x/onecloud/pkg/cloudcommon/db/taskman" + "yunion.io/x/onecloud/pkg/cloudprovider" "yunion.io/x/onecloud/pkg/compute/models" ) @@ -39,13 +39,13 @@ func (self *EipDissociateTask) OnInit(ctx context.Context, obj db.IStandaloneMod } extEip, err := eip.GetIEip() - if err != nil { + if err != nil && err != cloudprovider.ErrNotFound { msg := fmt.Sprintf("fail to find iEIP for eip %s", err) self.TaskFail(ctx, eip, msg, server) return } - if len(extEip.GetAssociationExternalId()) > 0 { + if err == nil && len(extEip.GetAssociationExternalId()) > 0 { err = extEip.Dissociate() if err != nil { msg := fmt.Sprintf("fail to remote dissociate eip %s", err)