[augeas-devel] [PATCH 1/4] new lens for MCollective.

Marc Fournier marc.fournier at camptocamp.com
Mon Oct 8 07:01:24 UTC 2012


---
 lenses/mcollective.aug            |   19 +++++++++++++
 lenses/tests/test_mcollective.aug |   53 +++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 lenses/mcollective.aug
 create mode 100644 lenses/tests/test_mcollective.aug

diff --git a/lenses/mcollective.aug b/lenses/mcollective.aug
new file mode 100644
index 0000000..3b1f37e
--- /dev/null
+++ b/lenses/mcollective.aug
@@ -0,0 +1,19 @@
+(*
+Module: MCollective
+  Parses MCollective's {client,server}.cfg configuration files
+
+Author: Marc Fournier <marc.fournier at camptocamp.com>
+
+About: License
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+*)
+
+module MCollective =
+autoload xfm
+
+let lns = Simplevars.lns
+
+let filter = incl "/etc/mcollective/client.cfg"
+           . incl "/etc/mcollective/server.cfg"
+
+let xfm = transform lns filter
diff --git a/lenses/tests/test_mcollective.aug b/lenses/tests/test_mcollective.aug
new file mode 100644
index 0000000..afad86f
--- /dev/null
+++ b/lenses/tests/test_mcollective.aug
@@ -0,0 +1,53 @@
+(*
+Module: Test_MCollective
+  Provides unit tests for the <MCollective> lens.
+*)
+
+module Test_MCollective =
+
+let conf = "topicprefix = /topic/
+main_collective = mcollective
+collectives = mcollective
+libdir = /usr/libexec/mcollective
+logger_type = console
+loglevel = warn
+
+# Plugins
+securityprovider = psk
+plugin.psk = unset
+
+connector = stomp
+plugin.stomp.host = localhost
+plugin.stomp.port = 61613
+plugin.stomp.user = mcollective
+plugin.stomp.password = secret
+
+# Facts
+factsource = yaml # bla
+plugin.yaml=/etc/mcollective/facts.yaml
+"
+
+test MCollective.lns get conf =
+  { "topicprefix" = "/topic/" }
+  { "main_collective" = "mcollective" }
+  { "collectives" = "mcollective" }
+  { "libdir" = "/usr/libexec/mcollective" }
+  { "logger_type" = "console" }
+  { "loglevel" = "warn" }
+  { }
+  { "#comment" = "Plugins" }
+  { "securityprovider" = "psk" }
+  { "plugin.psk" = "unset" }
+  { }
+  { "connector" = "stomp" }
+  { "plugin.stomp.host" = "localhost" }
+  { "plugin.stomp.port" = "61613" }
+  { "plugin.stomp.user" = "mcollective" }
+  { "plugin.stomp.password" = "secret" }
+  { }
+  { "#comment" = "Facts" }
+  { "factsource" = "yaml"
+    { "#comment" = "bla" }
+  }
+  { "plugin.yaml" = "/etc/mcollective/facts.yaml" }
+
-- 
1.7.10.4




More information about the augeas-devel mailing list