[elbe-devel] [PATCH 1/4] efilesystem: switch from subprocess.call() to shellhelper.system()

Bastian Germann bage at linutronix.de
Wed Jan 15 16:13:46 CET 2020


Am 15.01.20 um 16:10 schrieb Torben Hohn:
> subprocess.call() does not throw an exception upon error.
> 
> Use shellhelper.system() which throws CommandError upon error.
> 
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>

Reviewed-by: Bastian Germann <bage at linutronix.de>

> ---
>  elbepack/efilesystem.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
> index 3b2bf3a59..2230cfcb4 100644
> --- a/elbepack/efilesystem.py
> +++ b/elbepack/efilesystem.py
> @@ -36,8 +36,8 @@ def copy_filelist(src, filelist, dst):
>              st = src.stat(f)
>              dst.chown(f, st.st_uid, st.st_gid)
>          else:
> -            subprocess.call(["cp", "-a", "--reflink=auto",
> -                             src.fname(f), dst.fname(f)])
> +            system('cp -a --reflink=auto "%s" "%s"' % (src.fname(f),
> +                                                       dst.fname(f)))
>      # update utime which will change after a file has been copied into
>      # the directory
>      for f in filelist:
> 



More information about the elbe-devel mailing list