diff --git a/plugins/inventory/opennebula.py b/plugins/inventory/opennebula.py index 11b5bfc297..34e9df311a 100644 --- a/plugins/inventory/opennebula.py +++ b/plugins/inventory/opennebula.py @@ -200,7 +200,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable): server['name'] = vm.NAME server['id'] = vm.ID - if vm.HISTORY_RECORDS.HISTORY[-1]: + if vm.HISTORY_RECORDS.HISTORY: server['host'] = vm.HISTORY_RECORDS.HISTORY[-1].HOSTNAME server['LABELS'] = labels server['v4_first_ip'] = self._get_vm_ipv4(vm)