Merge pull request #2823 from ioito/hotfix/qx-add-secgroup

fix: 修复安全组关联数量校验不正确问题
This commit is contained in:
yunion-ci-robot
2019-09-09 23:48:20 +08:00
committed by GitHub
+1 -1
View File
@@ -941,7 +941,7 @@ func (self *SGuest) PerformAddSecgroup(ctx context.Context, userCred mcclient.To
}
originSecgroups := self.GetSecgroups()
if len(originSecgroups)+len(secgrpJsonArray) >= maxCount {
if len(originSecgroups)+len(secgrpJsonArray) > maxCount {
return nil, httperrors.NewUnsupportOperationError("guest %s band to up to %d security groups", self.Name, maxCount)
}