[anaconda][master][PATCH] Don't clear nonexistent DNF package download location (#1193121)

Brian C. Lane bcl at redhat.com
Mon Feb 16 19:52:14 UTC 2015


On Mon, Feb 16, 2015 at 06:41:45PM +0100, Martin Kolman wrote:
> Some installation sources, such as NFS, don't need it.
> So check if it exists before deleting it.
> 
> Signed-off-by: Martin Kolman <mkolman at redhat.com>
> ---
>  pyanaconda/packaging/dnfpayload.py | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
> index 136772a..265341b 100644
> --- a/pyanaconda/packaging/dnfpayload.py
> +++ b/pyanaconda/packaging/dnfpayload.py
> @@ -649,7 +649,15 @@ class DNFPayload(packaging.PackagePayload):
>          progressQ.send_message(post_msg)
>          process.join()
>          self._base.close()
> -        shutil.rmtree(self._download_location)
> +        if os.path.exists(self._download_location):
> +            log.info("Cleaning up downloaded packages: %s" % self._download_location)
> +            shutil.rmtree(self._download_location)
> +        else:
> +            # Some installation sources, such as NFS, don't need to download packages to
> +            # local storage, so the download location might not always exist. So for now
> +            # warn about this, at least until the RFE in bug 1193121 is implemented and
> +            # we don't have to care about clearing the download location ourselves.
> +            log.warning("Can't delete nonexistent download location: %s", self._download_location)
>  
>      def getRepo(self, repo_id):
>          """ Return the yum repo object. """
> -- 
> 2.1.0

Ack

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list