Update local metadata atomically using rename()

Change-Id: Id3b47db0d3ef3830f134d7f213e1d519d0466f60
Use testtools for better Python 2.6 compatibility

Testsuite uses assertDictEqual and a few others
which do not exist for Python 2.6. Use testtools
for those instead, which works the same for
all Python versions.

Change-Id: I7c6cba7c032a721f2ade0055066b9ddfac6a35c9
Rework testsuite to be section order agnostic

In Python 2.6, SafeConfigParser defaults to "dict", which
does not preserve section order. The testsuite was expecting
insertion order to be preserved, which is the case with
Python 2.7. According to Clint Byrum the actual code does
not worry about section ordering, so I reworked the tests
to sort sections into a welldefined order and run tests
then, which makes it pass for all Python versions.

Change-Id: Ia4e14018ae70c465b0b56d406d29fbb3c2ea280c
Add tests for cfn_hup.

Change-Id: Ibf69f99171c2c8316a0ea0a377e2fb186d5837b7
Run hooks even without cfn-init Metadata.

When we don't have AWS::CloudFormation::Init in Metadata, this just
means that cfn-init cannot do anything. However, cfn-hup still has hooks
which are just scheduled to be run on any change in the Metadata.

Fixes bug #1155999

Change-Id: I21c4f2137f8045128a86278b4d90768ea97455d1
Fix leaky tempfiles during test suite.

Each test run was producing 5 abandoned temp files.

Change-Id: I1c682b8e5a8782b1123b4a1bdb06dddca534e84b
cfn-hup : Moving erroneous print to use LOG.debug.

Change-Id: I6e567442cbc346b711b445c986095f1330131359
Fix pyflakes/hacking errors.

Change-Id: I6c364240d9e336fc4f38c2f4bc1fea2ae5e91511
Migrate to flake8.

Fixes bug 1172444

Change-Id: I68d5e58f6992f7357e3bb4f72ae40d0ebe076d4b
Merge "Fix pyflakes/hacking errors."
Merge "Migrate to flake8."
Merge "Fix leaky tempfiles during test suite."
Rename requires files to standard names

From bug report:
Rename tools/pip-requires to requirements.txt and tools/test-requires
to test-requirements.txt. These are standard files and tools in the
general world are growing intelligence about them.

Change-Id: I5d3bad7654e4ce101d19b40215d8c1cc93dd9832
Fixes: Bug #1179008
Add options to send user-defined metric

This allows the user to specify an arbitrary metric in their
template, and send the number based on some data they can
generate, e.g for openshift node occupancy data

Change-Id: Iaa38614b8db3665f9fb340fd92b67b6f7a47b206
Migrate to pbr.

Fixes bug 1179007

Change-Id: Iaa8a2722938d0b25df1041695f3c1c8dbf563b47
Include ChangeLog and AUTHORS

Similar to how other OpenStack components are built,
include a ChangeLog and AUTHORS file.

Change-Id: I28037aa3daf32e7e02dc2545ed3adf4227860d96
cfn-get-metadata: log metadata to standard output

Add display() method to the Metadata class that prints the metadata to
standard output if the metdata has been successfully retrieved (either
from local cache or from the remote server).

Change-Id: Idf6c1aecf2a5204d7cf7fbf3c8d826f750a72785
Fixes: bug #1183298
Use Python 3.x compatible octal literals

Python 3.x deprecated octal literals in the form
0755. Use 0o755  instead which works at least
with Python 2.6 and newer

Change-Id: I70dc33cb674499548732408924aa2ae728e17ea3
Add missing -d option in cfn-signal

Change-Id: I1d4f7f9a935d037e3b9f75f3b9627b2eaa560179
Fixes: bug #1192486
Delete the temporary directory created by sources handler

Register a hook to delete the temporary directory created by sources
handler at program cfn-init exit.

Change-Id: I821195cf510d35f94b1e7656dacc0dfe308ceeb1
Fixes: bug #1191674