Updated from global requirements

Change-Id: I43b1fd3ee22abbd9dfd23516b31d9417cb265c81
Change collector interface to return a list

With the new OS::Heat::StructuredDeployment resource, each Metadata
section may have multiple "deployments" in it. With this, we will return
a list with tuples of key and content to write to the cache.

Change-Id: I9f4272b0761e1dfd850bc5a5c6b27a78f126281f
Related-Bug: #1295787
Updated from global requirements

Change-Id: Id9ad5195dff8d65eed951061db5a34c31765b1b6
Parse deployments if found in cfn metadata

Will result in multiple cache files to be merged per
OS::Heat::StructuredDeployment. This is needed as the new features for
software configuration break things up a bit differently in Metadata.

Change-Id: Iec0fd947bac674f6b6f36e8c0789d10580c325fd
Closes-Bug: #1295787
Merge "Parse deployments if found in cfn metadata"
Add diagram to os-collect-config README.rst

Pictures are worth 1000 words. True story.

Change-Id: Ibd2048d9e61bfab6ddf0e6d663b2bbc2f0ff20c1
Updated from global requirements

Change-Id: Ie7556c4504e4de5f696c8b147cf4ee9dfd44f64e
Merge "Updated from global requirements"
Restore 'deployments' key to cfn Metadata

In recent changes support was added to explode the deployment key into
multiple json files for merging by os-apply-config. But this breaks
other users who want direct access to the full deployments structure.

There seems to be no real reason to delete the key other than tidiness,
so we will stop deleting it from the main cfn structure.

Change-Id: Icf9479376e32c3ad8f9be29359e6100c1aeda2a5
Closes-Bug: #1299110
Updated from global requirements

Change-Id: Ie1a20c6a46a0b79eaaa965322de75f82d698ec20
Cover deployments explosion case better in tests

When cfn explodes deployments we end up with many things stored per
collector, so some assumptions around 1:1 collector to cached content
cannot be made anymore.

Change-Id: I43c5fb759bc99690e0def1c6ecb672ab7f087df8
Test that collect_all works when nothing changed

This improves the test coverage for this very common case and sets up
for a new test which will expose that we fail in this case for exploded
deployments collected by the cfn collector.

Change-Id: I74807107824f8795619207389c064e83580c1c87
Related-Bug: #1307153
Commit changes to exploded deployments to cache

Before this, the exploded deployments that the cfn collector produced
would not ever be committed, and thus would always appear to have been
changed. This resulted in os-collect-config running the command
endlessly.

This requires some refactoring so that we commit changes to the cache
based on what was actually written, rather than just the static list of
collectors.

Closes-Bug: #1307153

Change-Id: I618ef5d752ed6519e8b7bfc090de03f2f24e73ce
Add collector for heat API resource metadata

This collector uses keystoneclient and heatclient to poll for the
configured resource metadata.

Changes were required to test_collect to allow collectors which needed
to fake something other than requests.

Change-Id: I3e93fe38b15f71193a4c024b24e6260d6adcf1b3
Merge "Restore 'deployments' key to cfn Metadata"
Merge "Updated from global requirements"
Merge "Add collector for heat API resource metadata"
Updated from global requirements

Change-Id: I7625287ca336937fb447b41e9f74e6cf1e3df034
Only top-level some deployment configs

Only config which contains os-apply-config data should be written
to the top level config structure. This change will only top-level
configs which are in the group os-apply-config or the default group
Heat::Ungrouped.

This tripleo-heat-templates change will specify a group for all
config resources https://review.openstack.org/#/c/91731/ however
the expected top-levels will still be written out without this
change.

This change is to fix heat software config when the config is not
json.

Change-Id: I16e42825121cf4968d4b0f0d266f4f6daa962921
Closes-Bug: #1299109
Merge "Only top-level some deployment configs"