Skip to content

Commit

Permalink
Merge pull request #18217 from PanSpagetka/fix-miq-template-virtual-cols
Browse files Browse the repository at this point in the history
Dont return different types in virtual columns

(cherry picked from commit ab470a4)

https://bugzilla.redhat.com/show_bug.cgi?id=1610927
  • Loading branch information
martinpovolny authored and simaishi committed Nov 27, 2018
1 parent 1f11197 commit ee46c90
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions app/models/miq_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ class MiqTemplate < VmOrTemplate
virtual_column :display_type, :type => :string
virtual_column :display_operating_system, :type => :string
virtual_column :display_platform, :type => :string
virtual_column :display_cpu_cores, :type => :string
virtual_column :display_memory, :type => :string
virtual_column :display_snapshots, :type => :string
virtual_column :display_tenant, :type => :string
virtual_column :display_deprecated, :type => :string
virtual_column :display_memory, :type => :integer

include_concern 'Operations'

Expand Down Expand Up @@ -83,28 +81,8 @@ def display_platform
end
end

def display_cpu_cores
if respond_to?(:volume_template?) || respond_to?(:volume_snapshot_template?)
_("N/A")
else
cpu_total_cores
end
end

def display_memory
if respond_to?(:volume_template?) || respond_to?(:volume_snapshot_template?)
_("N/A")
else
mem_cpu.to_i * 1024 * 1024
end
end

def display_snapshots
if respond_to?(:volume_template?) || respond_to?(:volume_snapshot_template?)
_("N/A")
else
v_total_snapshots
end
mem_cpu.to_i * 1024 * 1024
end

def display_tenant
Expand Down

0 comments on commit ee46c90

Please sign in to comment.