Reduce redundant debugging

This commit is contained in:
Isaac Connor
2023-08-02 13:05:57 -04:00
parent d56beead81
commit 54000bc204

View File

@@ -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");