From 01a3a40bcc43ffd492bea87e9b7b143bedccec37 Mon Sep 17 00:00:00 2001 From: "Mark T. Voelker" Date: Fri, 7 Mar 2014 02:49:30 -0500 Subject: [PATCH] Fix spurious warning in pipeline check The storage::server class includes a bit of logic that checks the pipeline and warns if ${type}-server isn't included. However, the check has a logic flaw such that if $pipeline is an array and contains ${type}-server, the warning is triggered anyway. This patch corrects the bad logic so that the warning isn't triggered spuriously. Change-Id: I7f81598f2f7910a2175fe772c9d82b2a1067826c Closes-Bug: #1289187 --- manifests/storage/server.pp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/manifests/storage/server.pp b/manifests/storage/server.pp index 3cc194ea..a475c0e7 100644 --- a/manifests/storage/server.pp +++ b/manifests/storage/server.pp @@ -25,12 +25,13 @@ define swift::storage::server( $config_file_path = "${type}-server/${name}.conf" ) { - # TODO if array does not include type-server, warn - if( - (is_array($pipeline) and ! member($pipeline, "${type}-server")) or - $pipeline != "${type}-server" - ) { + # Warn if ${type-server} isn't included in the pipeline + if is_array($pipeline) { + if !member($pipeline, "${type}-server") { warning("swift storage server ${type} must specify ${type}-server") + } + } elsif $pipeline != "${type}-server" { + warning("swift storage server ${type} must specify ${type}-server") } include "swift::storage::${type}"