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

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