From 00bea38f026272c8d68ba96e58877e9a7d72bbc7 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Wed, 22 Jul 2015 08:19:03 -0400 Subject: [PATCH] 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 --- playbooks/inventory/bifrost_inventory.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/playbooks/inventory/bifrost_inventory.py b/playbooks/inventory/bifrost_inventory.py index fefcb1295..7a1c50a68 100755 --- a/playbooks/inventory/bifrost_inventory.py +++ b/playbooks/inventory/bifrost_inventory.py @@ -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)