Change-Id: Iacd0d4d350dd392b93439addad63b1d4ee2e4694
Issue-Id: DCAEGEN2-151
Signed-off-by: Michael Hwang <mhwang@research.att.com>
* Setup database connection via manual user inputs if seed config not there
* Seeding profiles is no longer a fatal issue
* Dynamically fetch Docker login credentials from Consul to use to authenticate when creating Docker client.
* Setup database connection via manual user inputs if seed config not there
* Seeding profiles is no longer a fatal issue
* Dynamically fetch Docker login credentials from Consul to use to authenticate when creating Docker client.
+* Make docker login key into a configuration param
"""
return get_config().get("server_url")
"""
return get_config().get("server_url")
+def get_docker_logins_key():
+ """Returns the Consul key that Docker logins are stored under
+
+ Default is "docker_plugin/docker_logins" which matches up with the docker
+ plugin default.
+ """
+ return get_config().get("docker_logins_key", "docker_plugin/docker_logins")
+
# These functions are used to fetch the configurable path to the various json
# schema files used in validation.
# These functions are used to fetch the configurable path to the various json
# schema files used in validation.
from dcae_cli.util.logger import get_logger
from dcae_cli.util.exc import DcaeException
from dcae_cli.util.profiles import get_profile
from dcae_cli.util.logger import get_logger
from dcae_cli.util.exc import DcaeException
from dcae_cli.util.profiles import get_profile
+from dcae_cli.util.config import get_docker_logins_key
logger = get_logger('Discovery')
logger = get_logger('Discovery')
List of objects where the objects must be of the form
{"registry": .., "username":.., "password":.. }
"""
List of objects where the objects must be of the form
{"registry": .., "username":.., "password":.. }
"""
- key = "dockerlogin_info"
+ key = get_docker_logins_key()
(index, val) = Consul(host).kv.get(key)
if val:
(index, val) = Consul(host).kv.get(key)
if val: