[master][PATCH] Use dir_tree_map for the cleanPStore function

Martin Kolman mkolman at redhat.com
Mon Apr 7 16:44:53 UTC 2014


On Mon, 2014-04-07 at 18:34 +0200, Vratislav Podzimek wrote:
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
>  anaconda | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/anaconda b/anaconda
> index 88a3690..983135f 100755
> --- a/anaconda
> +++ b/anaconda
> @@ -740,12 +740,8 @@ def cleanPStore():
>      # is sufficient free space on the flash part.  On some machines this will
>      # take effect immediately, which is the best case.  Unfortunately on some,
>      # an intervening reboot is needed."""
> -    try:
> -        for root, _dirs, files in os.walk("/sys/fs/pstore"):
> -            for f in files:
> -                os.unlink("%s/%s" % (root,f))
> -    except OSError:
> -        pass
> +    from pyanaconda.iutil import dir_tree_map
> +    dir_tree_map(os.unlink, files=True, dirs=False)
That's clever! But is it clever enough to quess the path ? ;-)

>  
>  if __name__ == "__main__":
>      print "Starting installer, one moment..."




More information about the anaconda-patches mailing list