1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

L #-: Fix linting errors

This commit is contained in:
Tino Vazquez 2019-07-02 18:11:36 +02:00
parent 38e96b1632
commit 6a5e44d85b
No known key found for this signature in database
GPG Key ID: 2FE9C32E94AEABBE
2 changed files with 14 additions and 10 deletions

View File

@ -637,7 +637,8 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
end
begin
numa_nodes = host.to_hash['HOST']['HOST_SHARE']['NUMA_NODES']['NODE']
numa_nodes =
host.to_hash['HOST']['HOST_SHARE']['NUMA_NODES']['NODE']
rescue StandardError
numa_nodes = nil
end
@ -728,7 +729,7 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
table.show(pcis)
end
def print_numa_nodes(numa_nodes, str, str_h1)
def print_numa_nodes(numa_nodes)
numa_nodes = get_numa_data(numa_nodes)
print_numa_cores(numa_nodes)
@ -740,11 +741,11 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
numa_nodes = [numa_nodes] if numa_nodes.class == Hash
numa_nodes.map! do |core|
cores = core['CORE']
cores = core['CORE']
free, used, cores_str = get_numa_cores(cores)
core['CORE'] = {}
core['CORE'] = {}
core['CORE']['CORES'] = cores_str
core['CORE']['FREE'] = free
core['CORE']['USED'] = used
@ -838,7 +839,8 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
OpenNebulaHelper.unit_to_str(d['MEMORY']['USED'].to_i, {})
end
column :USED_ALLOCATED, 'U memory', :size => 20, :left => true do |d|
column :USED_ALLOCATED, 'U memory',
:size => 20, :left => true do |d|
OpenNebulaHelper.unit_to_str(d['MEMORY']['USAGE'].to_i, {})
end
@ -875,7 +877,9 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
end
column :SIZE, 'Pages size', :size => 8, :left => true do |d|
OpenNebulaHelper.unit_to_str(d['HUGEPAGE']['SIZE'].to_i/1024, {}, "M")
OpenNebulaHelper.unit_to_str(d['HUGEPAGE']['SIZE'].to_i / 1024,
{},
'M')
end
column :FREE, 'Free pages', :size => 8, :left => true do |d|

View File

@ -176,9 +176,9 @@ def memory(nodes, node_id)
end
nodes[node_id]['memory'] = {
'total' => bind.eval("#{:memtotal}"),
'free' => bind.eval("#{:memfree}"),
'used' => bind.eval("#{:memused}")
'total' => bind.eval(:memtotal.to_s),
'free' => bind.eval(:memfree.to_s),
'used' => bind.eval(:memused.to_s)
}
# Node distance to priotitize memory allocation
@ -192,7 +192,7 @@ def memory(nodes, node_id)
distance_h = {}
distance_a.each_with_index {|d, i| distance_h[d.to_i] = i }
distance_h = Hash[distance_h.sort_by {|k| k }]
distance_h = Hash[distance_h.sort]
closer = ''
distance_h.each {|_, v| closer << v.to_s << ' ' }