Strip ports list from inventory data

The ports information returned via shade's get_machine call returns
a data structure with links referencing where to find the ports in
the API. At some point, this data needs to be retrieved for the user
however until support for that exists, this data should be stripped
as the user cannot use it.

Change-Id: I16c1f5aa6ffe7a291d2dced5834f026a0fe03696
This commit is contained in:
Julia Kreger 2015-07-22 08:19:03 -04:00
parent f6318cdc25
commit 00bea38f02

View File

@ -314,8 +314,14 @@ def _process_shade(groups, hostvars):
else:
name = machine['name']
new_machine = {}
# TODO(TheJulia): At some point we need to retrieve the list of
# mac addresses from the ports and provide that information in the
# inventory output.
for key, value in six.iteritems(machine):
if 'links' not in key:
# NOTE(TheJulia): We don't want to pass infomrational links
# nor do we want to pass links about the ports since they
# are API endpoint URLs.
if key not in ['links', 'ports']:
new_machine[key] = value
new_machine['addressing_mode'] = "dhcp"
groups['baremetal']['hosts'].append(name)