diff options
author | Michael Hwang <mhwang@research.att.com> | 2017-09-18 13:25:28 -0400 |
---|---|---|
committer | Michael Hwang <mhwang@research.att.com> | 2017-09-19 09:42:33 -0400 |
commit | 249fa95e2bea21f840f3ee5c8311a0bfe13a1b3c (patch) | |
tree | a6f48400fe4bb7ecfc314639f24e355e97872aef /dcae-cli/dcae_cli/util/profiles.py | |
parent | 4188380fb7b806640103f557afec344455787a34 (diff) |
Make dcae-cli more tolerant aka configurable
* Seeding configuration is no longer a fatal issue
* Setup database connection
* Seeding profiles is no longer a fatal issue
Change-Id: Ica2150a1ca52bb422e4bf6d1213c6eacfb0ba128
Issue-Id: DCAEGEN2-110
Signed-off-by: Michael Hwang <mhwang@research.att.com>
Diffstat (limited to 'dcae-cli/dcae_cli/util/profiles.py')
-rw-r--r-- | dcae-cli/dcae_cli/util/profiles.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/dcae-cli/dcae_cli/util/profiles.py b/dcae-cli/dcae_cli/util/profiles.py index 83a7ca9..34580d6 100644 --- a/dcae-cli/dcae_cli/util/profiles.py +++ b/dcae-cli/dcae_cli/util/profiles.py @@ -27,6 +27,7 @@ import os from collections import namedtuple import six +import click from dcae_cli import util from dcae_cli.util import get_app_dir, get_pref, write_pref @@ -98,9 +99,14 @@ def reinit_profiles(): server_url = config.get_server_url() new_profiles = util.fetch_file_from_web(server_url, "/dcae-cli/profiles.json") except: - # REVIEW: Should we allow users to manually setup their config if not - # able to pull from remote server? - raise ProfilesInitError("Could not download profiles from remote server") + # Failing to pull seed profiles from remote server is not considered + # a problem. Just continue and give user the option to use an empty + # default. + if click.confirm("Could not download initial profiles from remote server. Set empty default?"): + new_profiles = {"default": { "consul_host": "", "config_binding_service": "", + "cdap_broker": "", "docker_host": ""}} + else: + raise ProfilesInitError("Could not setup dcae-cli profiles") profiles_path = get_profiles_path() |