fix: 修复安全组关联数量校验不正确问题

This commit is contained in:
ioito
2019-09-09 16:48:59 +08:00
parent c1d9124389
commit 2112bf7d79
+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)
}