mirror of
https://github.com/thegeeklab/docker-tidy.git
synced 2024-11-25 05:30:39 +00:00
Automatically determine the Docker API version to use instead of assuming the latest.
This commit is contained in:
parent
4c008ed05a
commit
773f97d450
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user