diff options
author | Michael Hwang <mhwang@research.att.com> | 2017-10-11 15:24:30 -0400 |
---|---|---|
committer | Michael Hwang <mhwang@research.att.com> | 2017-10-11 15:25:58 -0400 |
commit | 15e4f28ad05922d22f93075c897e1e6781aa9ebd (patch) | |
tree | af82981a9d9674c9d8b8c3cf50ddce0eb776738b /dcae-cli/dcae_cli | |
parent | 809230f9e3dea1adebbff4aa6927422bffc83ecc (diff) |
Make docker login key a configuration param
Change-Id: Iacd0d4d350dd392b93439addad63b1d4ee2e4694
Issue-Id: DCAEGEN2-151
Signed-off-by: Michael Hwang <mhwang@research.att.com>
Diffstat (limited to 'dcae-cli/dcae_cli')
-rw-r--r-- | dcae-cli/dcae_cli/util/config.py | 8 | ||||
-rw-r--r-- | dcae-cli/dcae_cli/util/discovery.py | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/dcae-cli/dcae_cli/util/config.py b/dcae-cli/dcae_cli/util/config.py index d3d9f16..3d6ac0a 100644 --- a/dcae-cli/dcae_cli/util/config.py +++ b/dcae-cli/dcae_cli/util/config.py @@ -110,6 +110,14 @@ def 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. diff --git a/dcae-cli/dcae_cli/util/discovery.py b/dcae-cli/dcae_cli/util/discovery.py index cbfd617..2b3c597 100644 --- a/dcae-cli/dcae_cli/util/discovery.py +++ b/dcae-cli/dcae_cli/util/discovery.py @@ -37,6 +37,7 @@ from consul import Consul 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') @@ -470,7 +471,7 @@ def get_docker_logins(host=consul_host): 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: |