[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[augeas-devel] [PATCH] add iscsid.conf lens



adds a lens for /etc/iscsi/iscsid.conf

---
 lenses/iscsid.aug |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100644 lenses/iscsid.aug

diff --git a/lenses/iscsid.aug b/lenses/iscsid.aug
new file mode 100644
index 0000000..6e3c7ae
--- /dev/null
+++ b/lenses/iscsid.aug
@@ -0,0 +1,22 @@
+module Iscsid =
+  autoload xfm
+
+  let filter = incl "/etc/iscsi/iscsid.conf"
+
+  let eol = Util.eol
+  let indent = Util.indent
+  let key_re = /[][A-Za-z0-9_.-]+/
+  let eq = del /[ \t]*=[ \t]*/ " = "
+  let value_re = /[^ \t\n](.*[^ \t\n])?/
+
+  let comment = [ indent . label "#comment" . del /[#;][ \t]*/ "# "
+        . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]
+
+  let empty = Util.empty
+
+  let kv = [ indent . key key_re . eq . store value_re . eol ]
+
+  let lns = (empty | comment | kv) *
+
+  let xfm = transform lns filter
+
-- 
1.6.5.2



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]