diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-19 10:10:14 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2022-04-20 16:04:20 +0100 |
commit | 77162849a6313083d493171826978ff58a53240a (patch) | |
tree | ba0780ccd70964342c65a9fe2b8118e7152104fa /tests/docker/docker.py | |
parent | 544f4a2578f0e8d0269383950499b2dc291f9fcf (diff) | |
download | qemu-77162849a6313083d493171826978ff58a53240a.zip qemu-77162849a6313083d493171826978ff58a53240a.tar.gz qemu-77162849a6313083d493171826978ff58a53240a.tar.bz2 |
tests/docker: remove SKIP_DOCKER_BUILD
It is now unused.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220401141326.1244422-17-pbonzini@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220419091020.3008144-20-alex.bennee@linaro.org>
Diffstat (limited to 'tests/docker/docker.py')
-rwxr-xr-x | tests/docker/docker.py | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 78dd131..d0af286 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -676,63 +676,6 @@ class CcCommand(SubCommand): as_user=True) -class CheckCommand(SubCommand): - """Check if we need to re-build a docker image out of a dockerfile. - Arguments: <tag> <dockerfile>""" - name = "check" - - def args(self, parser): - parser.add_argument("tag", - help="Image Tag") - parser.add_argument("dockerfile", default=None, - help="Dockerfile name", nargs='?') - parser.add_argument("--checktype", choices=["checksum", "age"], - default="checksum", help="check type") - parser.add_argument("--olderthan", default=60, type=int, - help="number of minutes") - - def run(self, args, argv): - tag = args.tag - - try: - dkr = Docker() - except subprocess.CalledProcessError: - print("Docker not set up") - return 1 - - info = dkr.inspect_tag(tag) - if info is None: - print("Image does not exist") - return 1 - - if args.checktype == "checksum": - if not args.dockerfile: - print("Need a dockerfile for tag:%s" % (tag)) - return 1 - - dockerfile = _read_dockerfile(args.dockerfile) - - if dkr.image_matches_dockerfile(tag, dockerfile): - if not args.quiet: - print("Image is up to date") - return 0 - else: - print("Image needs updating") - return 1 - elif args.checktype == "age": - timestr = dkr.get_image_creation_time(info).split(".")[0] - created = datetime.strptime(timestr, "%Y-%m-%dT%H:%M:%S") - past = datetime.now() - timedelta(minutes=args.olderthan) - if created < past: - print ("Image created @ %s more than %d minutes old" % - (timestr, args.olderthan)) - return 1 - else: - if not args.quiet: - print ("Image less than %d minutes old" % (args.olderthan)) - return 0 - - def main(): global USE_ENGINE |