[augeas-devel] augeas: master - Cobblermodules: lens + tests for cobbler's modules.conf
David Lutterkort
lutter at fedoraproject.org
Mon Feb 8 19:13:32 UTC 2010
Gitweb: http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=8447b0b4a41535fed9aee8cfa9d85efbd066acf1
Commit: 8447b0b4a41535fed9aee8cfa9d85efbd066acf1
Parent: e5b36fcd2f8a54e68b607127de0b3e9716541ef2
Author: Shannon Hughes <shughes at redhat.com>
AuthorDate: Mon Feb 8 11:11:43 2010 -0800
Committer: David Lutterkort <lutter at redhat.com>
CommitterDate: Mon Feb 8 11:11:43 2010 -0800
Cobblermodules: lens + tests for cobbler's modules.conf
---
AUTHORS | 1 +
lenses/cobblermodules.aug | 17 +++++++++++++++++
lenses/tests/test_cobblermodules.aug | 30 ++++++++++++++++++++++++++++++
3 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 20beade..1bdfe61 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -14,6 +14,7 @@ Contributions by:
Marc Fournier <marc.fournier at camptocamp.com>
Francis Giraldeau <francis.giraldeau at revolutionlinux.com>
Harald Hoyer <harald at redhat.com>
+ Shannon Hughes <shughes at redhat.com>
Bryan Kearney <bkearney at redhat.com>
Jim Meyering <meyering at redhat.com>
Sean Millichamp <sean at bruenor.org>
diff --git a/lenses/cobblermodules.aug b/lenses/cobblermodules.aug
new file mode 100644
index 0000000..21bf6f9
--- /dev/null
+++ b/lenses/cobblermodules.aug
@@ -0,0 +1,17 @@
+
+module CobblerModules =
+ autoload xfm
+
+let comment = IniFile.comment "#" "#"
+let sep = IniFile.sep "=" "="
+
+let entry = IniFile.entry IniFile.entry_re sep comment
+
+let title = IniFile.indented_title IniFile.record_re
+let record = IniFile.record title entry
+
+let lns = IniFile.lns record comment
+
+let filter = (incl "/etc/cobbler/modules.conf")
+
+let xfm = transform lns filter
diff --git a/lenses/tests/test_cobblermodules.aug b/lenses/tests/test_cobblermodules.aug
new file mode 100644
index 0000000..c525f6c
--- /dev/null
+++ b/lenses/tests/test_cobblermodules.aug
@@ -0,0 +1,30 @@
+module Test_cobblermodules =
+
+ let conf = "
+[serializes]
+settings = serializer_catalog
+
+[authentication]
+modules = auth_denyall
+"
+
+ test CobblerModules.lns get conf =
+ {}
+ { "serializes"
+ { "settings" = "serializer_catalog" }
+ {} }
+ { "authentication"
+ { "modules" = "auth_denyall" } }
+
+ test CobblerModules.lns put conf after
+ set "serializes/distro" "serializer_catalog";
+ set "serializes/repo" "serializer_catalog"
+ = "
+[serializes]
+settings = serializer_catalog
+
+distro=serializer_catalog
+repo=serializer_catalog
+[authentication]
+modules = auth_denyall
+"
More information about the augeas-devel
mailing list