From 54000bc204aee73609fac05cb9bb7aa6ed2d49c3 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 2 Aug 2023 13:05:57 -0400 Subject: [PATCH] Reduce redundant debugging --- scripts/ZoneMinder/lib/ZoneMinder/Storage.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Storage.pm b/scripts/ZoneMinder/lib/ZoneMinder/Storage.pm index 77c051a5f..016cafe18 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Storage.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Storage.pm @@ -154,13 +154,13 @@ sub delete_path { my $deleted = 0; - Debug("Delete $path"); - if ($$self{Type} and ( $$self{Type} eq 's3fs' )) { + if ($$self{Type} and ($$self{Type} eq 's3fs')) { + Debug("Delete $path"); my $s3 = $self->s3(); my $bucket = $self->bucket(); if ($s3 and $bucket) { eval { - if ( $bucket->delete_key($$self{aws_subpath}.$path) ) { + if ($bucket->delete_key($$self{aws_subpath}.$path)) { $deleted = 1; } else { Error('Failed to delete from S3:'.$s3->err . ': ' . $s3->errstr); @@ -170,10 +170,10 @@ sub delete_path { } # end if s3 } # end if s3fs - if ( !$deleted ) { + if (!$deleted) { my $storage_path = $self->Path(); - ( $storage_path ) = ( $storage_path =~ /^(.*)$/ ); # De-taint - ( $path ) = ( $path =~ /^(.*)$/ ); # De-taint + ($storage_path) = ($storage_path =~ /^(.*)$/); # De-taint + ($path) = ($path =~ /^(.*)$/); # De-taint my $command = "/bin/rm -rf $storage_path/$path 2>&1"; if (ZoneMinder::General::executeShellCommand($command)) { Error("Error deleting event directory at $storage_path/$path");