mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
fix(region): avoid purge zone (#19936)
This commit is contained in:
@@ -346,6 +346,13 @@ func (self *SZone) syncRemoveCloudZone(ctx context.Context, userCred mcclient.To
|
||||
lockman.LockObject(ctx, self)
|
||||
defer lockman.ReleaseObject(ctx, self)
|
||||
|
||||
cnt, err := self.getNetworkCount(ctx)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "getNetworkCount")
|
||||
}
|
||||
if cnt > 0 {
|
||||
return httperrors.NewNotEmptyError("contains %d networks", cnt)
|
||||
}
|
||||
return self.purgeAll(ctx, provider.Id)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user