Re: [libvirt-ci PATCH 03/13] lcitool: Prefer tempfile's native wrappers over low level primitives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2020-04-22 at 15:28 +0200, Erik Skultety wrote:
> Rather than requiring shutil module to get rid of the temporary
> directory we're creating for virt-install, let's use the
> TemporaryDirectory method instead which returns a file-like object which
> can be used to clean up the standard Python way.
> Although the internal exit handlers will take care of closing the
> temporary directories (and thus removing their contents) automatically,
> let's be explicit anyway and use the 'finally' clause to clean these up
> on both success and failure.
> 
> Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx>
> ---
>  guests/lcitool | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

Reviewed-by: Andrea Bolognani <abologna@xxxxxxxxxx>

-- 
Andrea Bolognani / Red Hat / Virtualization




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux