From bfba3ad7ac522e114c9b3fb03d354680c3b38162 Mon Sep 17 00:00:00 2001 From: Juan Badia Payno Date: Tue, 11 Sep 2018 18:18:12 +0200 Subject: [PATCH] Fix fluentd multifile problem. There is a problem on the current implementation. Currently the new_source variable is an Array of hashes, not a hash of hashes. The current impletation is wrong, as it can be seen for the following error at the log gate: http://logs.openstack.org/09/563009/7/check/tripleo-ci-centos-7-containers-multinode/aa4faf9/logs/undercloud/home/zuul/overcloud_deploy.log.txt.gz#_2018-09-03_15_17_39 [search for fluentd_service.pp] as there are too many lines at the same timestamp. Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, comparison of Hash with Hash failed at /etc/puppet/modules/fluentd/manifests/config.pp:6:16 at /etc/puppet/modules/tripleo/manifests/profile/base/logging/fluentd/fluentd_service.pp:47 on node centos-7-rax-iad-0001722758.localdomain Change-Id: Ifd5fbf6509addf4a564ff83c4551525c9a139ff4 --- .../base/logging/fluentd/fluentd_service.pp | 4 +-- ...ipleo_profile_base_logging_fluentd_spec.rb | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/manifests/profile/base/logging/fluentd/fluentd_service.pp b/manifests/profile/base/logging/fluentd/fluentd_service.pp index 28012be6f..3053afd72 100644 --- a/manifests/profile/base/logging/fluentd/fluentd_service.pp +++ b/manifests/profile/base/logging/fluentd/fluentd_service.pp @@ -38,10 +38,10 @@ define tripleo::profile::base::logging::fluentd::fluentd_service ( $values.filter|$index,$value| {$index == 'path'}.reduce({})|$memo,$x| {$memo + {'path' => regsubst($x[1], $fluentd_transform[0], $fluentd_transform[1]) } } } } else{ - $new_source = {} + $all + $new_source = any2array($all) } } else { - $new_source = {} + $sources + $new_source = any2array($sources) } ::fluentd::config { "100-openstack-${title}.conf": diff --git a/spec/classes/tripleo_profile_base_logging_fluentd_spec.rb b/spec/classes/tripleo_profile_base_logging_fluentd_spec.rb index 3cde6ac0b..e42769ec9 100644 --- a/spec/classes/tripleo_profile_base_logging_fluentd_spec.rb +++ b/spec/classes/tripleo_profile_base_logging_fluentd_spec.rb @@ -223,6 +223,35 @@ describe 'tripleo::profile::base::logging::fluentd' do end + context 'Multifiles -- horizon no transformation' do + let(:params) { { + :step => 4, + :fluentd_default_format => '/(?