Skip to content

Commit

Permalink
fix: agent enable feature permission
Browse files Browse the repository at this point in the history
  • Loading branch information
roryye authored and SongZhen0704 committed Aug 13, 2024
1 parent 12ded28 commit 938434e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/controller/http/service/vtap.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,20 +372,20 @@ func (a *Agent) Update(lcuuid, name string, vtapUpdate map[string]interface{}) (
return response[0], nil
}

func (a *Agent) BatchUpdate(updateMap []map[string]interface{}) (resp map[string][]string, err error) {
func (a *Agent) BatchUpdate(updateMap []map[string]interface{}) (map[string][]string, error) {
var description string
var succeedLcuuids []string
var failedLcuuids []string

var isNoPermission bool
for _, vtapUpdate := range updateMap {
if lcuuid, ok := vtapUpdate["LCUUID"].(string); ok {
_, _err := a.Update(lcuuid, "", vtapUpdate)
_, err := a.Update(lcuuid, "", vtapUpdate)
if errors.Is(err, httpcommon.ERR_NO_PERMISSIONS) {
isNoPermission = true
}
if _err != nil {
description += strings.TrimPrefix(_err.Error(), httpcommon.NO_PERMISSIONS)
if err != nil {
description += strings.TrimPrefix(err.Error(), httpcommon.NO_PERMISSIONS)
failedLcuuids = append(failedLcuuids, lcuuid)
} else {
succeedLcuuids = append(succeedLcuuids, lcuuid)
Expand Down

0 comments on commit 938434e

Please sign in to comment.