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.
pull/14984/head
Clark Boylan 9 years ago
parent 6b1b4e03b0
commit 7d5650219d

@ -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

Loading…
Cancel
Save