From 3243cafeb11d3b68908fc0a3648c1bdfd3036024 Mon Sep 17 00:00:00 2001 From: Guillaume Bougard Date: Fri, 14 Sep 2018 11:31:22 +0200 Subject: [PATCH] feature: quickly end maintenance on missing folder No need to run Maintenance task for Deploy if related datastore folder doesn't exist --- lib/FusionInventory/Agent/Task/Deploy/Maintenance.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/FusionInventory/Agent/Task/Deploy/Maintenance.pm b/lib/FusionInventory/Agent/Task/Deploy/Maintenance.pm index 63319e9775..eb34ea4b99 100644 --- a/lib/FusionInventory/Agent/Task/Deploy/Maintenance.pm +++ b/lib/FusionInventory/Agent/Task/Deploy/Maintenance.pm @@ -27,10 +27,15 @@ sub new { sub doMaintenance { my ($self) = @_; - my $folder = $self->{target}->getStorage()->getDirectory(); + my $folder = $self->{target}->getStorage()->getDirectory() + or return; + + $folder .= '/deploy'; + return unless -d $folder; + my $datastore = FusionInventory::Agent::Task::Deploy::Datastore->new( config => $self->{config}, - path => $folder.'/deploy', + path => $folder, logger => $self->{logger} );