[pve-devel] [PATCH storage] status: add unlink to worker in file upload

Lorenz Stechauner l.stechauner at proxmox.com
Wed Jul 21 14:52:17 CEST 2021


this is the first step in which not the http server removes the
temporary file, but the worker itself. for now, this `unlink`
statement won't unlink anything existing. but after changes to
the http server have been made, the endpoint will be able to
clean up for itself afterwards.

Signed-off-by: Lorenz Stechauner <l.stechauner at proxmox.com>
---
a version bump would be helpful, so the older versions can be
marked as 'breaks' in the pve-http-server repo after the above
mentioned changes.

 PVE/API2/Storage/Status.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/API2/Storage/Status.pm b/PVE/API2/Storage/Status.pm
index 72fd851..9275d1f 100644
--- a/PVE/API2/Storage/Status.pm
+++ b/PVE/API2/Storage/Status.pm
@@ -478,6 +478,7 @@ __PACKAGE__->register_method ({
 	    print "command: " . join(' ', @$cmd) . "\n";
 
 	    eval { PVE::Tools::run_command($cmd, errmsg => 'import failed'); };
+	    unlink $tmpfilename;
 	    if (my $err = $@) {
 		unlink $dest;
 		die $err;
-- 
2.30.2






More information about the pve-devel mailing list