2 Commits

Author SHA1 Message Date
Nolan Brubaker
18c9e1faee Add export host option for inventory-manage script
The export host option allows users to export their existing host
information for import into a third party system. The output is
'pivoted', so that the key is the host/container name, and the values
are the group memberships and hostvar information. Some top level
networking information, such as load balancer IP addresses, as well as
provider networks, are also provided.

Test scaffolding was added to ensure the export does what is intended.

The tox inventory environment was modified to do coverage testing of
both the dynamic_inventory.py and manage_inventory.py files. The
coverage data is erased between runs, since combined output lead to
incorrect results for dynamic_inventory.py.

Change-Id: I2caa5a0c070b12a74ac26334c63ac8d0de704042
2016-09-22 02:50:01 +00:00
Nolan Brubaker
c8791e0d09 Move inventory management code to enable imports
In order to import code from inventory-manage.py, such as for testing
purposes, the file must either be renamed or some very brittle hacks are
necessary to fake an import. This is due to the '-' character in the
file name.

To accomodate both the goal of importable code and maintained
compatibility, the contents of inventory-manage.py have been moved to
manage_inventory.py, and inventory-manage.py simply imports that code
and runs it.

No new functionality is added.

Change-Id: I60e73bed699b159f47e6c5b46d0787cf15fe1a4f
2016-09-18 22:16:20 -04:00