Merge pull request #8947 from yousong/bugfix/yousong-vm-changeip-eip

fix(region): change_ipaddr: retain eip_id on detach and attach
This commit is contained in:
Zexi Li
2020-11-25 09:27:59 +08:00
committed by GitHub
+6
View File
@@ -2093,6 +2093,12 @@ func (self *SGuest) PerformChangeIpaddr(ctx context.Context, userCred mcclient.T
}
return nil, httperrors.NewBadRequestError("%v", err)
}
if _, err := db.Update(&ngn[0], func() error {
ngn[0].EipId = gn.EipId
return nil
}); err != nil {
return nil, err
}
return ngn, nil
}()