diff --git a/src/cli/one_helper/onedatastore_helper.rb b/src/cli/one_helper/onedatastore_helper.rb index 72e141a188..9512eed32d 100644 --- a/src/cli/one_helper/onedatastore_helper.rb +++ b/src/cli/one_helper/onedatastore_helper.rb @@ -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) diff --git a/src/cli/one_helper/oneimage_helper.rb b/src/cli/one_helper/oneimage_helper.rb index dc3bf1c93b..9f007f0c11 100644 --- a/src/cli/one_helper/oneimage_helper.rb +++ b/src/cli/one_helper/oneimage_helper.rb @@ -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 }, diff --git a/src/oca/ruby/opennebula/image.rb b/src/oca/ruby/opennebula/image.rb index 502b6c22d1..720857154b 100644 --- a/src/oca/ruby/opennebula/image.rb +++ b/src/oca/ruby/opennebula/image.rb @@ -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