Skip to content

Commit

Permalink
Add other valid controllers to cgconfig lens
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Grimm authored and Dominic Cleal committed Jun 24, 2014
1 parent cf3de24 commit 45ed30e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Contributions by:
Freakin <[email protected]>
Marc Fournier <[email protected]>
Davide Guerri <[email protected]>
Andy Grimm <[email protected]>
Travis Groth <[email protected]>
Adam Helms <[email protected]>
Harald Hoyer <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Remove unused "filename" argument from dump-xml command, RHBZ#1100106
- Lens changes/additions
* AptPreferences: Support spaces in origin fields
* Cgconfig: handle additional valid controllers (Andy Grimm)
* Chrony: New lens to parse /etc/chrony.conf
* CPanel: New lens to parse cpanel.config files
* Desktop: Allow @ in keys (GH issue #92)
Expand Down
2 changes: 1 addition & 1 deletion lenses/cgconfig.aug
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module Cgconfig =

let id = /[a-zA-Z0-9_\/.-]+/
let name = /[^#= \n\t{}\/]+/
let cont_name = /(cpuacct|cpu|devices|ns|cpuset|memory|freezer|net_cls)/
let cont_name = /(cpuacct|cpu|devices|ns|cpuset|memory|freezer|net_cls|blkio|hugetlb|perf_event)/
let role_name = /(admin|task)/
let id_name = /(uid|gid)/
let address = /[^#; \n\t{}]+/
Expand Down
41 changes: 41 additions & 0 deletions lenses/tests/test_cgconfig.aug
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,44 @@ test Cgconfig.lns get group4 =
test Cgconfig.lns put "group tst {memory {}}" after
set "/group" "tst2"
= "group tst2 {memory {}}"

let group5="
group user {
cpuacct {}
cpu {}
cpuset {}
devices {}
freezer {}
memory {}
net_cls {}
blkio {}
hugetlb {}
perf_event {}
}"

test Cgconfig.lns get group5 =
{ }
{ "group" = "user"
{ }
{ "controller" = "cpuacct" }
{ }
{ "controller" = "cpu" }
{ }
{ "controller" = "cpuset" }
{ }
{ "controller" = "devices" }
{ }
{ "controller" = "freezer" }
{ }
{ "controller" = "memory" }
{ }
{ "controller" = "net_cls" }
{ }
{ "controller" = "blkio" }
{ }
{ "controller" = "hugetlb" }
{ }
{ "controller" = "perf_event" }
{ }
}

0 comments on commit 45ed30e

Please sign in to comment.