docker: Be compatible with older docker
authorFam Zheng <famz@redhat.com>
Wed, 3 Aug 2016 05:42:08 +0000 (13:42 +0800)
committerFam Zheng <famz@redhat.com>
Fri, 5 Aug 2016 08:34:52 +0000 (16:34 +0800)
By not using "--format" with docker images command.

The option is not available on RHEL 7 docker command. Use an awk
matching command instead.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <1470202928-3392-1-git-send-email-famz@redhat.com>

tests/docker/Makefile.include

index 78af46837b0e2a2781e54cf352216f4a723f5b6f..4f4707dae03344080d08bf7dec41a8a33eadb3e9 100644 (file)
@@ -107,9 +107,8 @@ docker-run-%: docker-qemu-src
        fi
        $(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
                $(call quiet-command,\
-                       if $(SRC_PATH)/tests/docker/docker.py images \
-                               --format={{.Repository}}:{{.Tag}} | \
-                                       grep -qx qemu:$(IMAGE); then \
+                       if $(SRC_PATH)/tests/docker/docker.py images | \
+                               awk '$$1=="qemu" && $$2=="$(IMAGE)"{found=1} END{exit(!found)}'; then \
                                $(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
                                -t \
                                $(if $(DEBUG),-i,--net=none) \