Fix issues with initialization 33/30933/1
authorMichael Hwang <mhwang@research.att.com>
Thu, 8 Feb 2018 22:26:40 +0000 (17:26 -0500)
committerMichael Hwang <mhwang@research.att.com>
Thu, 8 Feb 2018 22:27:45 +0000 (17:27 -0500)
Change-Id: Ib9520e4f5bd1d257a9281a60ea55c5fd2704e948
Issue-ID: DCAEGEN2-322
Signed-off-by: Michael Hwang <mhwang@research.att.com>
dcae-cli/README.md
dcae-cli/dcae_cli/_version.py
dcae-cli/dcae_cli/util/config.py
dcae-cli/dcae_cli/util/profiles.py

index 2806f5e..c96e5e2 100644 (file)
@@ -4,9 +4,21 @@ The `dcae-cli` is a Python command-line tool used to manage and to test componen
 
 ## Documentation
 
-Please review the [DCAE platform documentation](ONAP URL TBD) which has a detailed [`dcae-cli` walkthrough](ONAP URL TBD).
+Please review the [DCAE platform documentation](http://onap.readthedocs.io/en/latest/submodules/dcaegen2.git/docs/index.html) which has a detailed [`dcae-cli` walkthrough](http://onap.readthedocs.io/en/latest/submodules/dcaegen2.git/docs/sections/components/dcae-cli/walkthrough.html).
 
-## Local use
+## Usage
+
+You will be prompted to initialize the `dcae-cli` the first time you run the tool.  You also have the option to [re-initializing using the `--reinit` flag](http://onap.readthedocs.io/en/latest/submodules/dcaegen2.git/docs/sections/components/dcae-cli/quickstart.html#reinit).
+
+You will be prompted to provide a remote server url.  The remote server is expected to host several required artifacts that the `dcae-cli` requires like the json schemas to do validation.  Use the following to use the bleeding edge:
+
+```
+Please enter the remote server url: https://git.onap.org/dcaegen2/platform/cli/plain
+```
+
+You will also be prompted for details on the postgres database to connect with.  Follow the instructions below to run a local instance and provide the connection details in the initialization.
+
+### Local use
 
 The dcae-cli requires access to an onboarding catalog which is a postgres database.  If there is no shared instance for your team or organization, then a workaround is to run a local instance of postgres on your machine.  One quick way is to run a postgres Docker container:
 
@@ -15,5 +27,3 @@ docker run -e POSTGRES_PASSWORD=<your password> -e PGDATA=/var/lib/postgresql/da
 ```
 
 Use your favorite sql client to log into this local instance and create a database named `dcae_onboarding_db`.
-
-Now that your onboarding catalog is setup, run `dcae_cli --reinit` and walkthrough the prompts to configure your dcae-cli to point to this local instance.
index 3f09935..329a73d 100644 (file)
@@ -19,4 +19,4 @@
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 
 # -*- coding: utf-8 -*-
-__version__ = "2.9.0"
+__version__ = "2.9.1"
index 3d6ac0a..e3257af 100644 (file)
@@ -69,7 +69,6 @@ def _init_config():
     try:
         server_url = _init_config_server_url()
         new_config = util.fetch_file_from_web(server_url, "/dcae-cli/config.json")
-        new_config["server_url"] = server_url
     except:
         # Failing to pull seed configuration from remote server is not considered
         # a problem. Just continue and give user the option to set it up
@@ -77,6 +76,8 @@ def _init_config():
         if not click.confirm("Could not download initial configuration from remote server. Attempt manually setting up?"):
             raise ConfigurationInitError("Could not setup dcae-cli configuration")
 
+    # UPDATE: Keeping the server url even though the config was not found there.
+    new_config["server_url"] = server_url
     new_config["user"] = _init_config_user()
     new_config["cli_version"] = _version.__version__
 
@@ -123,11 +124,11 @@ def get_docker_logins_key():
 
 def get_path_component_spec():
     return get_config().get("path_component_spec",
-            "/schemas/component-specification/dcae-cli-v1/component-spec-schema.json")
+            "/component-json-schemas/component-specification/dcae-cli-v1/component-spec-schema.json")
 
 def get_path_data_format():
     return get_config().get("path_data_format",
-            "/schemas/data-format/dcae-cli-v1/data-format-schema.json")
+            "/component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json")
 
 def get_active_profile():
     return get_config().get("active_profile", None)
index 34580d6..721b0aa 100644 (file)
@@ -103,8 +103,9 @@ def reinit_profiles():
         # 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": ""}}
+            new_profiles = {"default": { "consul_host": "",
+                "config_binding_service": "config_binding_service",
+                "cdap_broker": "cdap_broker", "docker_host": ""}}
         else:
             raise ProfilesInitError("Could not setup dcae-cli profiles")