Skip to content

Commit

Permalink
validate: add the validation of devices.access
Browse files Browse the repository at this point in the history
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
  • Loading branch information
zhouhao committed Apr 28, 2017
1 parent 02e86dd commit 723baa1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,15 @@ func (v *Validator) CheckLinuxResources() (msgs []string) {
msgs = append(msgs, fmt.Sprintf("type of devices %s is invalid", r.Devices[index].Type))
}

access := []byte(r.Devices[index].Access)
for i := 0; i < len(access); i++ {
switch access[i] {
case 109, 114, 119:
default:
msgs = append(msgs, fmt.Sprintf("access %s is invalid", r.Devices[index].Access))
return
}
}
}

return
Expand Down

0 comments on commit 723baa1

Please sign in to comment.