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
Change-Id: I0251f2c70574aeaa79997ce822d2a5ffbe08e345
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
Change-Id: I62b097bafa339fefcf6e03d11636f5ab622fb71a
This will allow tools like os-apply-config to read the list even when
they are run out of band from os-collect-config.
Change-Id: Ic4eaf649e234f4a1367d20c7ec52e93e787a7bb3
The option allows other programs to find the cache directory and files
without having access to OS_CONFIG_FILES.
Change-Id: Iad87efb65ea4db387e94160376c9eaf956fff413
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
Change-Id: I090de7a3d84e0ea342f1a422646c0c455eb37f4a
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.
Change-Id: I94ba4f61be9595a6ddee134d806e5f99ae4adf73
__main__ is called directly during tests, but was resetting the
logging environment within it, which prevented tests from capturing
the log events.
Change-Id: If710e11091723144c97c88aab4aa5e6126844d2b
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.
Change-Id: Idf3a09686b4bbf0e16a9bc9f3359ee9937fcc627
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.
Change-Id: Ia29c1ef9e10308d6461dae7823c5f497f6b90122
FakePopen will make the migration to check_call easier, and narrowly
replaces the engire rather than replacing the subprocess entry point.
Change-Id: Ic868ce4cdbef79f256ef01a9a030767522b855a3
The default order results in less-dynamic heat_local and ec2 overriding
the more dynamic cfn source. That is the opposite of what is desired.
Change-Id: I7e1feb2e6869b4f076200668dd204219ecc4224e
Heat does not give us the exact API version to request, so we must infer
version 1 (/v1/) since that is what we speak. The other test cases are
all updated to use /v1/ too, so that the fakes can remain the same.
Change-Id: Ifb74546db16836aaa67fdd647aad2c5cf8aa84b4
If a source always fails to read, but others succeeded, the ensuing
commit of all collectors results in an unhandled IOError coming from
shutil.copy. However, commit on an uncollected source should just
be a noop, as there is nothing to commit.
Change-Id: I726c7bbaa561a3c21b61eba5e5d100b0fe324954
After we have run a command and committed, re-execute ourselves. This
ensures that we will get any configurations that may have come from
underlying commands. Also re-execute if os-collect-config is sent HUP.
Change-Id: I87b4d8ce44fcbc9458a3a4fbb2445e4c9d0ad4e7
Heat passes this in via cloud-init to assist heat-cfntools in finding the
cfn metadata server url. This will likely be the primary location used,
and cfn.metadata_url will be an override.
Also doing some cleanup, removed unused cfn.EC2_METADATA_URL and
reordered and regrouped imports.
Change-Id: I52093bdd8a4b939ae06cf483535ed5d5a0e273d4
This makes os-collect-config stay resident and prepares it for a more
event based operation when the Heat API is ready for that via longpoll
or callbacks or something else.
Change-Id: Ic91f2201d504e9f8e0ada6d34a7d6d94785aec87
setup.cfg depends on the README file for its long description, so if
it's not in the source tarball, the build will bomb out. README.rst is an
automatically grokked name of a file for python and gets included
automatically. While we're dealing with this, add a MANIFEST.in to
ensure that AUTHORS and ChangeLog get installed too.
Change-Id: Id59fa5a6fecc179a80710ba8a5dc898fb713b1cf
Positional arguments now specify which collectors to use. This allows
disabling a collector if it is problematic, and also re-ordering of the
emitted $OS_CONFIG_FILES from the default order if necessary.
Change-Id: I7e76db991c0b16c529c1cbf9a1ba9beb78e45482