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

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