2.2.1 dcaepolicyplugin and data types 79/39279/2
authorAlex Shatov <alexs@att.com>
Tue, 27 Mar 2018 21:12:31 +0000 (17:12 -0400)
committerAlex Shatov <alexs@att.com>
Tue, 27 Mar 2018 21:12:31 +0000 (17:12 -0400)
commit768c68b6fa25ab2faa9f7dbffdae2cbb2bd6e218
treecef25ca671633f9e4e2d6b784cd5ad8b1970d0dd
parent342c2890e9b46b483244773b2337c8f56ae9bd0d
2.2.1 dcaepolicyplugin and data types

- trying to avoid changing code for k8s deployment of
  policy-handler with unknown url to MSB or policy-handler
  at the moment
- expecting optional manual population of the consul-kv
  with config data for dcaepolicyplugin

- when not found service for policy-handler in consul
  -- try finding config for "dcaepolicyplugin" in consul-kv
  -- the config structure is expected to contain
      url to policy_handler
- example of config value for key=dcaepolicyplugin:
{
    "dcaepolicyplugin" : {
        "policy_handler" : {
            "url" : "http://policy-handler:25577"
        }
    }
}
- still drop down to hardcoded default when this config
   not found in consul-kv

- added and refactored unit tests for discovery -- coverage 78%
- making code more PEP8 compliant

Change-Id: Ia176b54ed62631baa30d614785d1937023408ddf
Signed-off-by: Alex Shatov <alexs@att.com>
Issue-ID: DCAEGEN2-419
dcae-policy/README.md
dcae-policy/dcaepolicy-node-type.yaml
dcae-policy/dcaepolicyplugin/discovery.py
dcae-policy/dcaepolicyplugin/tasks.py
dcae-policy/pom.xml
dcae-policy/setup.py
dcae-policy/tests/log_ctx.py
dcae-policy/tests/mock_cloudify_ctx.py
dcae-policy/tests/mock_setup.py [new file with mode: 0644]
dcae-policy/tests/test_discovery.py [new file with mode: 0644]
dcae-policy/tests/test_tasks.py