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.
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.
* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.
While this is called a "cache", it is important for it to survive. On
reboot, servers may need what was in the cfn config to restore complex
We introduce a new command line option, --backup-cachedir, that will
default to the old path, /var/run/os-collect-config. This will keep
things working for any tools that have been hard coded to use the old
We pass the list of json files containing the collected metadata to
os-refresh-config using the OS_CONFIG_FILES env variable, so it's a
pretty useful piece of information to log.
tox 1.6 was released, which means that we can now take advantage of
the feature we added to it - which is using setup.py develop to
install the code into the virtualenv. The logic was taken from
run_tests.sh - so the performance issues around using tox vs. using
install_venv should now be gone.
Additionally, override the tox pip install command to avoid using the
"--pre" option which is the default in tox. "--pre" means "Include
pre-release and development versions." By default, pip will only
install stable versions of software, and that is the behavior we want.
Co-Authored-By: Monty Taylor <email@example.com>
The initial value of 300 seconds was a conservative estimate. However,
the requests and responses are somewhat small, so we can drop the polling
interval significantly and still maintain a high degree of network
scalability. After measuring the responses from the ec2 and cfn servers
with typical workloads, at 30 second intervals 100 servers will generate
around 26kB/s of requests, with about 66kB/s of responses.
Without this change, if a user runs os-collect-config --force, it will
lock the user in an infinite loop running the command over and over with
very little chance to cancel. There are no compelling use cases for that
behavior, but it is extremely inconvenient, so implying --one-time
improves usability of os-collect-config for users.
The use case for --print is an administrator wanting to view the
metadata that os-collect-config sees without running any commands.
Fixes bug #1213195
This is a useful debugging and/or system fixer tool for instances where
metadata has not changed but one needs to re-run the configuration.
Fixes bug #1223693
Keep a hash of the config file for os-collect-config and if it changes
during a failed run then rerun immediately(without sleep), effectively
causing new nodes to be ready 5 minutes earlier.
Because the cfn credentials are placed into os-collect-config.conf by
os-apply-config and are not in place the first time os-collect-config is
run, the first run of os-collect-config results in error, o-c-c then
sleeps for 5 minutes before running successfully the second time.
Fixes bug #1219186
On a system with o-c-c installed by pip the binary generated by PBR
calls __main__() directly, the code that sets up logging sould be placed
here otherwise it will be bypassed. Resulting in missing log messages.
The point of delaying the commit of data to the cache is that we want to
make sure the command succeeds before giving up on the data changes.
This will ensure that we keep trying the command with any given change
to the metadata until it succeeds.
Smart hooks may want to perform delta analysis on metadata, and tests
want to be able to tell if the cache is updated it's previous state,
so we should make the presence and name of the old versions of the
files a stable interface.