From 2de95edebaa92072aa857ca70961cd7bdaf7a77d Mon Sep 17 00:00:00 2001 From: Michael Hwang Date: Wed, 1 Aug 2018 16:22:13 -0400 Subject: Do first pass on dcae onboarding vagrant * Provide Vagrantfile etc to standup a VirtualBox image that runs a minimal DCAE runtime for onboarding * Add README with directions on how to do above * Make minor fixes to the dcae-cli for issues discovered from testing above Issue-ID: DCAEGEN2-574 Change-Id: I99ea595df9e5e2b9a872b864e553caec1f020669 Signed-off-by: Michael Hwang --- dcae-cli/dcae_cli/util/docker_util.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'dcae-cli/dcae_cli/util/docker_util.py') diff --git a/dcae-cli/dcae_cli/util/docker_util.py b/dcae-cli/dcae_cli/util/docker_util.py index a0499d6..7ae933f 100644 --- a/dcae-cli/dcae_cli/util/docker_util.py +++ b/dcae-cli/dcae_cli/util/docker_util.py @@ -1,7 +1,7 @@ # ============LICENSE_START======================================================= # org.onap.dcae # ================================================================================ -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,21 +83,10 @@ def get_docker_client(profile, logins=[]): except: raise DockerError('Could not connect to the Docker daemon. Is it running?') -def _get_docker_client(client_funcs=(docker.Client, docker.from_env)): - '''Returns a docker client object''' - for func in client_funcs: - try: - client = func(version='auto') - client.ping() - return client - except: - continue - raise DockerError('Could not connect to the Docker daemon. Is it running?') - def image_exists(image): '''Returns True if the image exists locally''' - client = _get_docker_client() + client = docker.from_env(version="auto") return True if client.images(image) else False -- cgit 1.2.3-korg