From d5f0a003d22cd3daa94e23d80534e119675cb3fa Mon Sep 17 00:00:00 2001 From: Ladislav Smola Date: Thu, 9 Nov 2017 12:26:38 +0100 Subject: [PATCH] Make sure volume template has name Make sure volume template has name Fixes BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1510067 --- .../providers/openstack/inventory/parser/cloud_manager.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/manageiq/providers/openstack/inventory/parser/cloud_manager.rb b/app/models/manageiq/providers/openstack/inventory/parser/cloud_manager.rb index ff378d8db..69a134673 100644 --- a/app/models/manageiq/providers/openstack/inventory/parser/cloud_manager.rb +++ b/app/models/manageiq/providers/openstack/inventory/parser/cloud_manager.rb @@ -24,7 +24,7 @@ def volume_templates next if vt.attributes["bootable"].to_s != "true" volume_template = persister.miq_templates.find_or_build(vt.id) volume_template.type = "ManageIQ::Providers::Openstack::CloudManager::VolumeTemplate" - volume_template.name = vt.name + volume_template.name = vt.name.blank? ? "N/A" : vt.name volume_template.cloud_tenant = persister.cloud_tenants.lazy_find(vt.tenant_id) if vt.tenant_id volume_template.location = "N/A" volume_template.vendor = "openstack" @@ -36,7 +36,7 @@ def volume_snapshot_templates # next if vt["attributes"].["bootable"].to_s != "true" volume_template = persister.miq_templates.find_or_build(vt["id"]) volume_template.type = "ManageIQ::Providers::Openstack::CloudManager::VolumeSnapshotTemplate" - volume_template.name = vt['display_name'] || vt['name'] + volume_template.name = (vt['display_name'] || vt['name']).blank? ? "N/A" : (vt['display_name'] || vt['name']) volume_template.cloud_tenant = persister.cloud_tenants.lazy_find(vt["tenant_id"]) if vt["tenant_id"] volume_template.location = "N/A" volume_template.vendor = "openstack"