From 7d5650219db04fd7af2cc7347dbc9c098931a1d2 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 15 Mar 2016 16:42:06 -0700 Subject: [PATCH] Fix openstack inventory for multiple servers Fix openstack inventory for when we have multiple servers with the same name but different IDs. Instead of giving every server with the same name the details for the first server returned with that name add the individual servers as they are returned. This was a logic bug where in a loop over a list of servers we always added the first server in that list despite having more than one server. --- contrib/inventory/openstack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/inventory/openstack.py b/contrib/inventory/openstack.py index cc1f6dbed6..e868778850 100755 --- a/contrib/inventory/openstack.py +++ b/contrib/inventory/openstack.py @@ -149,7 +149,7 @@ def get_host_groups_from_cloud(inventory): else: for server in servers: append_hostvars( - hostvars, groups, server['id'], servers[0], + hostvars, groups, server['id'], server, namegroup=True) groups['_meta'] = {'hostvars': hostvars} return groups