diff options
author | Dan Fandrich <danf@mageia.org> | 2024-01-25 22:08:27 -0800 |
---|---|---|
committer | Dan Fandrich <danf@mageia.org> | 2024-01-25 22:08:27 -0800 |
commit | b72addd101159ffe4fa403b70c840e649d6cb7b8 (patch) | |
tree | ee03a7ba4aabdbc84101664301510262e15e2123 | |
parent | 4804730d59a8d00961434e6d291c9bc942e5bd92 (diff) | |
download | puppet-b72addd101159ffe4fa403b70c840e649d6cb7b8.tar puppet-b72addd101159ffe4fa403b70c840e649d6cb7b8.tar.gz puppet-b72addd101159ffe4fa403b70c840e649d6cb7b8.tar.bz2 puppet-b72addd101159ffe4fa403b70c840e649d6cb7b8.tar.xz puppet-b72addd101159ffe4fa403b70c840e649d6cb7b8.zip |
Fix spec-tree-reports report generation
Remove errors.log or the report won't be generated. Also, log stderr to
the journal or else the normal stderr logs will cause a spurious cron
e-mail to be sent.
-rw-r--r-- | modules/spec-tree-reports/manifests/init.pp | 2 | ||||
-rw-r--r-- | modules/spec-tree-reports/templates/generate-spec-rpm-mismatch-report | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/modules/spec-tree-reports/manifests/init.pp b/modules/spec-tree-reports/manifests/init.pp index 5623090b..dc78ea72 100644 --- a/modules/spec-tree-reports/manifests/init.pp +++ b/modules/spec-tree-reports/manifests/init.pp @@ -40,7 +40,7 @@ class spec-tree-reports( } cron { "rpm_mismatch_report": - command => "/usr/local/bin/generate-spec-rpm-mismatch-report | systemd-cat -t generate-spec-rpm-mismatch-report", + command => "/usr/local/bin/generate-spec-rpm-mismatch-report |& systemd-cat -t generate-spec-rpm-mismatch-report", hour => $hour, minute => $minute, user => $user, diff --git a/modules/spec-tree-reports/templates/generate-spec-rpm-mismatch-report b/modules/spec-tree-reports/templates/generate-spec-rpm-mismatch-report index 25f866d0..966d6946 100644 --- a/modules/spec-tree-reports/templates/generate-spec-rpm-mismatch-report +++ b/modules/spec-tree-reports/templates/generate-spec-rpm-mismatch-report @@ -4,6 +4,7 @@ set -e trap 'test "$?" -ne 0 && echo Error in script' EXIT cd "$HOME" +test -e errors.log && mv -f errors.log errors.log.1 /usr/bin/generate-mismatch-report --srpm_source <%= scope.function_shellquote([scope.lookupvar('srpms')]) -%> --release <%= scope.function_shellquote([scope.lookupvar('release')]) %> cp report.html <%= scope.function_shellquote([scope.lookupvar('report')]) %> rm -f report.html |