]> git.proxmox.com Git - pve-storage.git/commitdiff
followup: code cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 10 Apr 2019 08:14:46 +0000 (10:14 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 10 Apr 2019 08:15:42 +0000 (10:15 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/API2/Storage/Content.pm

index 4aa9daf840203d0d78c69736b65108e83f387f4d..cd4746be60ff3bb70acbe3c338acd502b3c9b1ea 100644 (file)
@@ -307,12 +307,12 @@ __PACKAGE__->register_method ({
        }
 
        PVE::Storage::vdisk_free ($cfg, $volid);
-       if ($vtype eq 'backup' && $path =~
-           /(.*\/vzdump-\w+-\d+-\d{4}_\d{2}_\d{2}-\d{2}_\d{2}_\d{2})[^\/]+$/) {
+
+       if ($vtype eq 'backup'
+           && $path =~ /(.*\/vzdump-\w+-\d+-\d{4}_\d{2}_\d{2}-\d{2}_\d{2}_\d{2})[^\/]+$/) {
            my $logpath = "$1.log";
-           if (-e $logpath) {
-               unlink($logpath);
-           }
+           # try to cleanup our backup log file too, if still exisiting, #318
+           unlink($logpath) if -e $logpath;
        }
 
        return undef;