[elbe-devel] [PATCH 1/4] soapclient: apply os.path.basename to filename in upload package
Manuel Traut
manuel.traut at linutronix.de
Thu Apr 26 17:30:40 CEST 2018
On Thu, Apr 26, 2018 at 05:01:46PM +0200, Torben Hohn wrote:
> passing absolute paths to "elbe prjrepo upload_file" results
> in Errors, because the filename is generated via
> os.path.join (builddir, fname) in the soap server
>
> this yields fname for absolute path fname.
>
> fix this on the the client side, by passing os.path.basename(f)
> to the soapmethod.
>
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
Reviewed-by: Manuel Traut <manut at linutronix.de>
will apply it to devel/elbe-3.0
> ---
> elbepack/soapclient.py | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
> index 785e217c..16c90687 100644
> --- a/elbepack/soapclient.py
> +++ b/elbepack/soapclient.py
> @@ -830,12 +830,12 @@ class UploadPackageAction(RepoAction):
> # finish upload
> if len(xml_base64) == 1:
> part = client.service.upload_file(builddir,
> - f,
> + os.path.basename(f),
> xml_base64,
> -1)
> else:
> part = client.service.upload_file(builddir,
> - f,
> + os.path.basename(f),
> xml_base64,
> part)
> if part == -1:
> @@ -889,7 +889,7 @@ class UploadPackageAction(RepoAction):
> self.upload_file(client, f, builddir)
>
> print("Including Package in initvm...")
> - client.service.include_package(builddir, filename)
> + client.service.include_package(builddir, os.path.basename(filename))
>
>
> RepoAction.register(UploadPackageAction)
> --
> 2.11.0
>
>
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel
More information about the elbe-devel
mailing list