qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 for 3.0 13/18] docker: add --hint to docker.p


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH v3 for 3.0 13/18] docker: add --hint to docker.py check
Date: Tue, 24 Jul 2018 15:46:55 +0800

On Wed, Jul 18, 2018 at 4:03 AM Alex Bennée <address@hidden> wrote:
>
> When a check fails we currently just report why we failed. This is not
> totally helpful to people who want to boot-strap a new image. Add a
> --hint option which we can pass down to give a bit more information.
>
> Signed-off-by: Alex Bennée <address@hidden>
> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> Tested-by: Philippe Mathieu-Daudé <address@hidden>
> ---
>  tests/docker/Makefile.include | 3 ++-
>  tests/docker/docker.py        | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index ec23620153..c9e412f9d0 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -73,7 +73,8 @@ docker-binfmt-image-debian-%: 
> $(DOCKER_FILES_DIR)/debian-bootstrap.docker
>                         $(if 
> $(EXECUTABLE),--include-executable=$(EXECUTABLE)), \
>                         "BUILD","binfmt debian-$* (debootstrapped)"),         
>   \
>                 $(call quiet-command,                                         
>   \
> -                       $(DOCKER_SCRIPT) check --quiet qemu:debian-$* $<,     
>   \
> +                       $(DOCKER_SCRIPT) check --quiet qemu:debian-$* $<      
>   \
> +                       --hint "you will need to build $(EXECUTABLE)",        
>   \
>                         "CHECK", "debian-$* exists"))
>
>  endif
> diff --git a/tests/docker/docker.py b/tests/docker/docker.py
> index 2f81c6b13b..523f4b95a2 100755
> --- a/tests/docker/docker.py
> +++ b/tests/docker/docker.py
> @@ -475,6 +475,7 @@ class CheckCommand(SubCommand):
>                              default="checksum", help="check type")
>          parser.add_argument("--olderthan", default=60, type=int,
>                              help="number of minutes")
> +        parser.add_argument("--hint", default="", help="hint to user")
>
>      def run(self, args, argv):
>          tag = args.tag
> @@ -487,7 +488,7 @@ class CheckCommand(SubCommand):
>
>          info = dkr.inspect_tag(tag)
>          if info is None:
> -            print("Image does not exist")
> +            print("Image does not exist %s" % (args.hint))

No, please. This is just hacky and makes no sense to me. The Makefile
can do this

  $(DOCKER_SCRIPT) check ... || { echo "you will need to build
$(EXECUTABLE)"; exit 1 }

Fam

>              return 1
>
>          if args.checktype == "checksum":
> --
> 2.17.1
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]