From 8293c3ec4e04bfa29fb8eea713568178dc0fa551 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 25 Mar 2019 21:39:41 +0100 Subject: [PATCH] Replace Config::Any with YAML::Tiny --- systemd-journal-gelf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/systemd-journal-gelf b/systemd-journal-gelf index ec4ca44..1d622b7 100644 --- a/systemd-journal-gelf +++ b/systemd-journal-gelf @@ -8,14 +8,18 @@ use Encode qw(encode); use Data::Dumper; use Compress::Zlib; use Getopt::Long; -use Config::Any; +use YAML::Tiny; my $config = '/etc/systemd/journal-gelf.yml'; my $conf = {}; if (-e $config) { print "Reading config file $config\n"; - $conf = Config::Any->load_files( { files => [ $config ], flatten_to_hash => 1, use_ext => 1 } )->{$config}; + my $yaml = YAML::Tiny->read( $config ) or die "Config file $config is invalid\n"; + if (not $yaml->[0]) { + die "Config file $config is invalid\n" + } + $conf = $yaml->[0]; } GetOptions (