[pve-devel] [PATCH v3 storage 1/3] status: move unlink from http-server to enpoint

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Aug 26 18:30:30 CEST 2021


On 03/08/2021 14:16, Lorenz Stechauner wrote:
> this is the first step in which not the http server removes the
> temporary file, but the worker itself.
> 
> Signed-off-by: Lorenz Stechauner <l.stechauner at proxmox.com>
> ---
>  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 b838461..a5ac372 100644
> --- a/PVE/API2/Storage/Status.pm
> +++ b/PVE/API2/Storage/Status.pm
> @@ -486,6 +486,7 @@ __PACKAGE__->register_method ({
>  	    print "command: " . join(' ', @$cmd) . "\n";
>  
>  	    eval { run_command($cmd, errmsg => 'import failed'); };
> +	    unlink $tmpfilename or warn "unable to clean up temporary file '$tmpfilename' - $!";

and doesn't this have the same issues as you recently fixed in regards to the node
not being the local one and thus ssh/scp being used?

>  	    if (my $err = $@) {
>  		eval { $err_cleanup->() };
>  		warn "$@" if $@;
> 






More information about the pve-devel mailing list