fix(region): guest sync eip fix

This commit is contained in:
tangbin
2021-04-06 18:13:41 +08:00
committed by TangBin
parent cd9a97aef5
commit 3be7a103c3
+8 -2
View File
@@ -4919,10 +4919,16 @@ func (self *SGuest) GetPublicIp() (*SElasticip, error) {
func (self *SGuest) SyncVMEip(ctx context.Context, userCred mcclient.TokenCredential, provider *SCloudprovider, extEip cloudprovider.ICloudEIP, syncOwnerId mcclient.IIdentityProvider) compare.SyncResult {
result := compare.SyncResult{}
eip, err := self.GetEipOrPublicIp()
eip, err := self.GetPublicIp()
if err != nil {
result.Error(fmt.Errorf("getEip error %s", err))
result.Error(fmt.Errorf("getPublicIp error %s", err))
return result
} else if eip == nil {
eip, err = self.GetElasticIp()
if err != nil {
result.Error(fmt.Errorf("getEip error %s", err))
return result
}
}
if eip == nil && extEip == nil {