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

Feature #1678: CLI does not hide system DS capacity

This commit is contained in:
Carlos Martín 2013-10-17 17:02:47 +02:00 committed by Javi Fontan
parent debdc9a92c
commit 1e7679d9b3

View File

@ -49,11 +49,7 @@ class OneDatastoreHelper < OpenNebulaHelper::OneHelper
end
column :SIZE, "Datastore total size", :size =>10 do |d|
if d['TEMPLATE']['TYPE'] == 'SYSTEM_DS'
"-"
else
OpenNebulaHelper.unit_to_str(d['TOTAL_MB'].to_i, {}, 'M')
end
OpenNebulaHelper.unit_to_str(d['TOTAL_MB'].to_i, {}, 'M')
end
column :AVAIL, "Datastore free size", :left, :size =>5 do |d|
@ -115,8 +111,6 @@ class OneDatastoreHelper < OpenNebulaHelper::OneHelper
str="%-15s: %-20s"
str_h1="%-80s"
system = datastore.type == 1
CLIHelper.print_header(str_h1 % "DATASTORE #{datastore['ID']} INFORMATION")
puts str % ["ID", datastore.id.to_s]
puts str % ["NAME", datastore.name]
@ -132,9 +126,9 @@ class OneDatastoreHelper < OpenNebulaHelper::OneHelper
puts
CLIHelper.print_header(str_h1 % "DATASTORE CAPACITY", false)
puts str % ["TOTAL:", system ? '-' : OpenNebulaHelper.unit_to_str(datastore['TOTAL_MB'].to_i, {},'M')]
puts str % ["USED: ", system ? '-' : OpenNebulaHelper.unit_to_str(datastore['USED_MB'].to_i, {},'M')]
puts str % ["FREE:", system ? '-' : OpenNebulaHelper.unit_to_str(datastore['FREE_MB'].to_i, {},'M')]
puts str % ["TOTAL:", OpenNebulaHelper.unit_to_str(datastore['TOTAL_MB'].to_i, {},'M')]
puts str % ["USED: ", OpenNebulaHelper.unit_to_str(datastore['USED_MB'].to_i, {},'M')]
puts str % ["FREE:", OpenNebulaHelper.unit_to_str(datastore['FREE_MB'].to_i, {},'M')]
puts
CLIHelper.print_header(str_h1 % "PERMISSIONS",false)