diff --git a/contrib/inventory/ovirt.py b/contrib/inventory/ovirt.py index f406704ed6..7f505d9826 100755 --- a/contrib/inventory/ovirt.py +++ b/contrib/inventory/ovirt.py @@ -211,7 +211,7 @@ class OVirtInventory(object): 'ovirt_uuid': inst.get_id(), 'ovirt_id': inst.get_id(), 'ovirt_image': inst.get_os().get_type(), - 'ovirt_machine_type': inst.get_instance_type(), + 'ovirt_machine_type': self.get_machine_type(inst), 'ovirt_ips': ips, 'ovirt_name': inst.get_name(), 'ovirt_description': inst.get_description(), @@ -230,6 +230,11 @@ class OVirtInventory(object): """ return [x.get_name() for x in inst.get_tags().list()] + def get_machine_type(self,inst): + inst_type = inst.get_instance_type() + if inst_type: + return self.driver.instancetypes.get(id=inst_type.id).name + # noinspection PyBroadException,PyUnusedLocal def get_instance(self, instance_name): """Gets details about a specific instance """