From 773f97d450fe3a059968df8628a06fca210a728b Mon Sep 17 00:00:00 2001 From: John Schrantz Date: Wed, 2 Sep 2015 12:58:04 -0500 Subject: [PATCH] Automatically determine the Docker API version to use instead of assuming the latest. --- docker_custodian/docker_autostop.py | 2 +- docker_custodian/docker_gc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker_custodian/docker_autostop.py b/docker_custodian/docker_autostop.py index 0e56536..2672825 100644 --- a/docker_custodian/docker_autostop.py +++ b/docker_custodian/docker_autostop.py @@ -66,7 +66,7 @@ def main(): stream=sys.stdout) opts = get_opts() - client = docker.Client(timeout=opts.timeout) + client = docker.Client(version='auto', timeout=opts.timeout) matcher = build_container_matcher(opts.prefix) stop_containers(client, opts.max_run_time, matcher, opts.dry_run) diff --git a/docker_custodian/docker_gc.py b/docker_custodian/docker_gc.py index 14a1e18..121096d 100644 --- a/docker_custodian/docker_gc.py +++ b/docker_custodian/docker_gc.py @@ -170,7 +170,7 @@ def main(): stream=sys.stdout) args = get_args() - client = docker.Client(timeout=args.timeout) + client = docker.Client(version='auto', timeout=args.timeout) if args.max_container_age: cleanup_containers(client, args.max_container_age, args.dry_run)