Gitweb:        
http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=8447b0b4a41535fed9aee8cfa9d85efbd066acf1
Commit:        8447b0b4a41535fed9aee8cfa9d85efbd066acf1
Parent:        e5b36fcd2f8a54e68b607127de0b3e9716541ef2
Author:        Shannon Hughes <[email protected]>
AuthorDate:    Mon Feb 8 11:11:43 2010 -0800
Committer:     David Lutterkort <[email protected]>
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    <[email protected]>
   Francis Giraldeau <[email protected]>
   Harald Hoyer     <[email protected]>
+  Shannon Hughes   <[email protected]>
   Bryan Kearney    <[email protected]>
   Jim Meyering     <[email protected]>
   Sean Millichamp  <[email protected]>
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
+"

_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to