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

Feature #1068: The onedatastore command now shows the DISK_TYPE

This commit is contained in:
Jaime Melis 2013-02-13 17:57:33 +01:00
parent a64f23372a
commit 20df320d7c
3 changed files with 6 additions and 3 deletions

View File

@ -110,6 +110,7 @@ class OneDatastoreHelper < OpenNebulaHelper::OneHelper
puts str % ["DS_MAD", datastore['DS_MAD']]
puts str % ["TM_MAD", datastore['TM_MAD']]
puts str % ["BASE PATH",datastore['BASE_PATH']]
puts str % ["DISK_TYPE",Image::DISK_TYPES[datastore['DISK_TYPE'].to_i]]
puts
CLIHelper.print_header(str_h1 % "PERMISSIONS",false)

View File

@ -102,14 +102,14 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
{
:name => "disk_type",
:large => "--disk_type disk_type",
:description => "Type of the image (BLOCK, CDROM or FILE)",
:description => "Type of the image (BLOCK, CDROM, RBD or FILE)",
:format => String,
:proc => lambda do |o, options|
type=o.strip.upcase
if %w{BLOCK CDROM FILE}.include? type
if %w{BLOCK CDROM FILE RBD}.include? type
[0, type]
else
[-1, "Disk type must be BLOCK, CDROM or FILE"]
[-1, "Disk type must be BLOCK, CDROM, RBD or FILE"]
end
end
},

View File

@ -64,6 +64,8 @@ module OpenNebula
"CONTEXT" => "CX"
}
DISK_TYPES=%w{FILE CD_ROM BLOCK RBD}
# Creates an Image description with just its identifier
# this method should be used to create plain Image objects.
# +id+ the id of the image