fix(region): check kvm vpc and security group relation (#19292)

This commit is contained in:
屈轩
2024-01-18 14:34:56 +08:00
committed by GitHub
parent 36254142a9
commit d01474470c
+1 -1
View File
@@ -1995,7 +1995,7 @@ func (self *SVpc) CheckSecurityGroupConsistent(secgroup *SSecurityGroup) error {
if secgroup.Status != api.SECGROUP_STATUS_READY {
return httperrors.NewInvalidStatusError("security group %s status is not ready", secgroup.Name)
}
if len(secgroup.ExternalId) == 0 {
if len(self.ExternalId) > 0 && len(secgroup.ExternalId) == 0 {
return httperrors.NewInvalidStatusError("The security group %s does not have an external id", secgroup.Name)
}
if len(secgroup.VpcId) > 0 {