From a6fb8b87e0b22e089844c7d7260bf729e568e9c6 Mon Sep 17 00:00:00 2001
From: Guillaume Rousse <guillaume.rousse@renater.fr>
Date: Tue, 7 Nov 2017 16:42:48 +0100
Subject: [PATCH] simplification

---
 lib/IdPAccountManager/Tools.pm | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/lib/IdPAccountManager/Tools.pm b/lib/IdPAccountManager/Tools.pm
index ebd3320..7ceca5e 100644
--- a/lib/IdPAccountManager/Tools.pm
+++ b/lib/IdPAccountManager/Tools.pm
@@ -87,18 +87,14 @@ sub update_ssp_authsources {
     my $tt2 = Template->new({
         INCLUDE_PATH => $templates_dir
     });
-    my %args = (
+    my $template = 'accountProfiles/valid-accounts.php.tt2';
+    my $data = {
         accounts => IdPAccountManager::Data::TestAccount::Manager->get_testaccounts(),
         conf     => $conf,
-    );
-
-    my $template_file = 'accountProfiles/valid-accounts.php.tt2';
-    my $output_file   = 'conf/valid-accounts.php';
-
-    unless ($tt2->process($template_file, \%args, $output_file)) {
-        return undef;
-    }
+    };
+    my $output   = 'conf/valid-accounts.php';
 
+    return $tt2->process($template, $data, $output);
 }
 
 1;
-- 
GitLab