Blame SOURCES/0001-Syslog-restored-Augeas-1.1.0-tree-compatibility-for-.patch

84dac3
From 706266780350ba61d36ec387dc18e9f4764ed872 Mon Sep 17 00:00:00 2001
84dac3
From: Yanis Guenane <yguenane@gmail.com>
84dac3
Date: Sun, 8 Sep 2013 09:30:17 -0400
84dac3
Subject: [PATCH] Syslog: restored Augeas 1.1.0 tree compatibility for UDP
84dac3
 hosts
84dac3
84dac3
UDP host entries don't require the { "protocol" = "@" } node, it's only
84dac3
used for TCP hosts.
84dac3
---
84dac3
 lenses/syslog.aug             | 10 +++++++---
84dac3
 lenses/tests/test_rsyslog.aug |  1 -
84dac3
 lenses/tests/test_syslog.aug  |  7 +++----
84dac3
 3 files changed, 10 insertions(+), 8 deletions(-)
84dac3
84dac3
diff --git a/lenses/syslog.aug b/lenses/syslog.aug
84dac3
index f8b99c40..17c0f903 100644
84dac3
--- a/lenses/syslog.aug
84dac3
+++ b/lenses/syslog.aug
84dac3
@@ -66,6 +66,10 @@ module Syslog =
84dac3
 	 Deletes a semicolon and default to it
84dac3
 	 *)
84dac3
 	let semicolon  = sep_tab_opt . Util.del_str ";" . sep_tab_opt
84dac3
+	(* Variable: at
84dac3
+	 Deletes a at and default to it
84dac3
+	 *)
84dac3
+	let at         = Util.del_str "@"
84dac3
 	(* Variable: dot
84dac3
 	 Deletes a dot and default to it
84dac3
 	 *)
84dac3
@@ -105,10 +109,10 @@ module Syslog =
84dac3
         let comparison = /(!|[<=>]+|![<=>]+)/
84dac3
 
84dac3
 	(* Variable: protocol
84dac3
-	  @ means UDP
84dac3
+	  @ means UDP (removed, no protocol node is used for compatibility with 1.1.0)
84dac3
     @@ means TCP
84dac3
 	  *)
84dac3
-        let protocol      = /@{1,2}/
84dac3
+        let protocol      = /@@/
84dac3
 
84dac3
 	(* Variable: token
84dac3
 	  alphanum or "*"
84dac3
@@ -185,7 +189,7 @@ module Syslog =
84dac3
 	(* View: loghost
84dac3
 	 a loghost is an @  sign followed by the hostname and a possible port
84dac3
 	 *)
84dac3
-	let loghost = [label "protocol" . store protocol] . [ label "hostname" . store loghost_r ] .
84dac3
+	let loghost = ([label "protocol" . store protocol] | at) . [ label "hostname" . store loghost_r ] .
84dac3
 	    (colon . [ label "port" . store /[0-9]+/ ] )?
84dac3
 
84dac3
 	(* View: users
84dac3
diff --git a/lenses/tests/test_rsyslog.aug b/lenses/tests/test_rsyslog.aug
84dac3
index e696139c..46b24c3c 100644
84dac3
--- a/lenses/tests/test_rsyslog.aug
84dac3
+++ b/lenses/tests/test_rsyslog.aug
84dac3
@@ -86,7 +86,6 @@ test Rsyslog.lns get conf =
84dac3
       { "level" = "*" }
84dac3
     }
84dac3
     { "action"
84dac3
-      { "protocol" = "@" }
84dac3
       { "hostname" = "2.7.4.1" }
84dac3
     }
84dac3
   }
84dac3
diff --git a/lenses/tests/test_syslog.aug b/lenses/tests/test_syslog.aug
84dac3
index 2ad1c165..329d121e 100644
84dac3
--- a/lenses/tests/test_syslog.aug
84dac3
+++ b/lenses/tests/test_syslog.aug
84dac3
@@ -91,11 +91,11 @@ daemon.info                                     /var/log/cvsupd.log
84dac3
 	  }
84dac3
 	  { "entry"
84dac3
 	    { "selector" { "facility" = "*" } { "level" = "*" } }
84dac3
-	    { "action" { "protocol" = "@" } { "hostname" = "syslog.far.away" } }
84dac3
+	    { "action" { "hostname" = "syslog.far.away" } }
84dac3
 	  }
84dac3
 	  { "entry"
84dac3
 	    { "selector" { "facility" = "*" } { "level" = "*" } }
84dac3
-	    { "action" { "protocol" = "@" } { "hostname" = "syslog.far.away" } { "port" = "123" } }
84dac3
+	    { "action" { "hostname" = "syslog.far.away" } { "port" = "123" } }
84dac3
 	  }
84dac3
 	  { "entry"
84dac3
 	    { "selector" { "facility" = "*" } { "level" = "*" } }
84dac3
@@ -107,7 +107,7 @@ daemon.info                                     /var/log/cvsupd.log
84dac3
 	  }
84dac3
 	  { "entry"
84dac3
 	    { "selector" { "facility" = "*" } { "level" = "*" } }
84dac3
-	    { "action" { "protocol" = "@" } { "hostname" = "[2001::1]" } { "port" = "514" } }
84dac3
+	    { "action" { "hostname" = "[2001::1]" } { "port" = "514" } }
84dac3
 	  }
84dac3
 	  { "entry"
84dac3
 	    { "selector" { "facility" = "*" } { "level" = "*" } }
84dac3
@@ -260,7 +260,6 @@ daemon.info                                     /var/log/cvsupd.log
84dac3
 	(* changing file to remote host *)
84dac3
 	test Syslog.lns put "*.* /var\n" after
84dac3
 	  rm "/entry/action/file" ;
84dac3
-	  set "/entry/action/protocol"  "@" ;
84dac3
 	  set "/entry/action/hostname" "far.far.away"
84dac3
 	  = "*.* @far.far.away\n"
84dac3
 
84dac3
-- 
84dac3
2.13.6
84dac3