From db4ac0fb382acad36965f998b61ed750c79e1f47 Mon Sep 17 00:00:00 2001 From: Jan Friesse Date: Wed, 11 Jul 2012 17:39:07 +0200 Subject: [PATCH] Support for crypto_ and nodelist in lenses Signed-off-by: Jan Friesse Reviewed-by: Fabio M. Di Nitto --- conf/lenses/corosync.aug | 18 ++++++++++++++++- conf/lenses/tests/test_corosync.aug | 31 +++++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/conf/lenses/corosync.aug b/conf/lenses/corosync.aug index 30504784..1f0b054e 100644 --- a/conf/lenses/corosync.aug +++ b/conf/lenses/corosync.aug @@ -51,6 +51,8 @@ let totem = |kv "vsftype" /none|ykd/ |kv "secauth" /on|off/ |kv "crypto_type" /nss|aes256/ + |kv "crypto_cipher" /none|nss|aes256/ + |kv "crypto_hash" /none|md5|sha1|sha256|sha384|sha512/ |kv "transport" /udp|iba/ |kv "version" Rx.integer |kv "nodeid" Rx.integer @@ -160,6 +162,20 @@ let uidgid = qstr /uid|gid/ in section "uidgid" setting -let lns = (comment|empty|totem|quorum|logging|resources|service|uidgid)* +(* The node section *) +let node = + let setting = + qstr /ring[0-9]_addr/ + |kv "nodeid" Rx.integer + |kv "quorum_votes" Rx.integer in + section "node" setting + +(* The nodelist section *) +let nodelist = + let setting = + node in + section "nodelist" setting + +let lns = (comment|empty|totem|quorum|logging|resources|service|uidgid|nodelist)* let xfm = transform lns (incl "/etc/corosync/corosync.conf") diff --git a/conf/lenses/tests/test_corosync.aug b/conf/lenses/tests/test_corosync.aug index f67782fb..486b5433 100644 --- a/conf/lenses/tests/test_corosync.aug +++ b/conf/lenses/tests/test_corosync.aug @@ -5,7 +5,8 @@ module Test_corosync = totem { version: 2 secauth: off - crypto_type: nss + crypto_cipher: none + crypto_hash: none threads: 0 clear_node_high_bit: no rrp_mode: none @@ -70,6 +71,20 @@ resources { uidgid { uid: 0 gid: 0 +} + +nodelist { + node { + ring0_addr: 192.168.122.1 + nodeid: 1 + quorum_votes: 2 + } + + node { + ring0_addr: 192.168.122.2 + ring1_addr: 192.168.123.1 + nodeid: 2 + } }\n" test Corosync.lns get conf = @@ -79,7 +94,8 @@ test Corosync.lns get conf = { "totem" { "version" = "2" } { "secauth" = "off" } - { "crypto_type" = "nss" } + { "crypto_cipher" = "none" } + { "crypto_hash" = "none" } { "threads" = "0" } { "clear_node_high_bit" = "no" } { "rrp_mode" = "none" } @@ -134,3 +150,14 @@ test Corosync.lns get conf = { "uidgid" { "uid" = "0" } { "gid" = "0" } } + { } + { "nodelist" + { "node" + { "ring0_addr" = "192.168.122.1" } + { "nodeid" = "1" } + { "quorum_votes" = "2" } } + { } + { "node" + { "ring0_addr" = "192.168.122.2" } + { "ring1_addr" = "192.168.123.1" } + { "nodeid" = "2" } } } -- 2.39.5