mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-22 13:33:52 +03:00
(cherry picked from commit 3df4cbb1d3
)
This commit is contained in:
parent
4a45ddcbc9
commit
2c5a11863e
@ -169,8 +169,7 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
|
||||
:name => 'no_check_capacity',
|
||||
:large => '--no_check_capacity',
|
||||
:description =>
|
||||
'Check Datastore capacity. By Default YES',
|
||||
:format => String
|
||||
'Do not check Datastore capacity, only for admins.'
|
||||
}
|
||||
|
||||
FILTERS = [
|
||||
|
@ -217,11 +217,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
exit(-1)
|
||||
end
|
||||
|
||||
if options[:no_check_capacity].nil?
|
||||
check_capacity = false
|
||||
else
|
||||
check_capacity = true
|
||||
end
|
||||
no_check_capacity = !options[:no_check_capacity].nil?
|
||||
|
||||
conflicting_opts = []
|
||||
if (args[0] || !(stdin = OpenNebulaHelper.read_stdin).empty?) &&
|
||||
@ -264,7 +260,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
exit 0
|
||||
end
|
||||
|
||||
image.allocate(template, options[:datastore], check_capacity)
|
||||
image.allocate(template, options[:datastore], no_check_capacity)
|
||||
rescue StandardError => e
|
||||
STDERR.puts e.message
|
||||
exit(-1)
|
||||
|
@ -869,8 +869,8 @@ int ImageManager::register_image(int iid,
|
||||
image_msg_t msg(ImageManagerMessages::MKFS, "", img->get_oid(), drv_msg);
|
||||
imd->write(msg);
|
||||
|
||||
oss << "Creating disk at " << source << " of "<< img->get_size()
|
||||
<< "Mb (format: " << img->get_format() << ")";
|
||||
oss << "Creating disk at " << img->get_ds_name() << ", size " << img->get_size()
|
||||
<< "MB (format: " << img->get_format() << ")";
|
||||
}
|
||||
}
|
||||
else //PATH -> COPY TO REPOSITORY AS SOURCE
|
||||
|
@ -115,11 +115,12 @@ module OpenNebula
|
||||
#
|
||||
# @param description [String] A string containing the template of the Image.
|
||||
# @param ds_id [Integer] the target datastore ID
|
||||
# @param no_check_capacity [Boolean] true to skip capacity check. Only for admins.
|
||||
#
|
||||
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
||||
# otherwise
|
||||
def allocate(description, ds_id, check_capacity=true)
|
||||
super(IMAGE_METHODS[:allocate],description, ds_id, check_capacity)
|
||||
def allocate(description, ds_id, no_check_capacity=false)
|
||||
super(IMAGE_METHODS[:allocate],description, ds_id, no_check_capacity)
|
||||
end
|
||||
|
||||
# Replaces the template contents
|
||||
|
@ -455,7 +455,7 @@ void ImageAllocate::request_execute(xmlrpc_c::paramList const& params,
|
||||
|
||||
if ( params.size() > 3 && att.is_admin() )
|
||||
{
|
||||
check_capacity = xmlrpc_c::value_boolean(params.getBoolean(3));
|
||||
check_capacity = !params.getBoolean(3);
|
||||
}
|
||||
|
||||
Nebula& nd = Nebula::instance();
|
||||
|
Loading…
Reference in New Issue
Block a user