Fix Python 3 incompatibility in tripleo-ansible-inventory
When running under Python 3, the keys() method on a dict returns a dict_keys object, not a list. The dict_keys object can't be indexed like a list, so an exception is thrown. This patch switches from using the keys() method to using list() on the dict instead, which returns a list of the keys. Change-Id: Ifb1814f2406318c4c42edc21581a6fc6d34eb91e
This commit is contained in:
parent
9f411bec5d
commit
c8a490f25b
|
@ -153,7 +153,7 @@ def main():
|
|||
host_network=configs.ssh_network,
|
||||
serial=configs.serial)
|
||||
|
||||
inventory_keys = inventory_map.keys()
|
||||
inventory_keys = list(inventory_map)
|
||||
if len(inventory_keys) == 1:
|
||||
inventory = inventory_map[inventory_keys[0]]
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue