mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09:00
Feature #2858: Improve onevnet updatear command
This commit is contained in:
1 parent
faa407e0ec
commit
97c8aee648
2 files changed
+17
-8
No files matched your search
+13
-7
@@ -72,6 +72,10 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
helper.filterflag_to_i(arg)
|
||||
end
|
||||
|
||||
set :format, :ar_id, "Integer" do |arg|
|
||||
format_int(arg)
|
||||
end
|
||||
|
||||
########################################################################
|
||||
# Commands
|
||||
########################################################################
|
||||
@@ -307,18 +311,20 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
exit -1
|
||||
end
|
||||
|
||||
obj.delete_element("AR_POOL/AR[AR_ID!=#{args[1]}]")
|
||||
obj.delete_element("AR_POOL/AR/LEASES")
|
||||
obj.delete_element("AR_POOL/AR/USED_LEASES")
|
||||
|
||||
if obj.template_like_str("AR_POOL").empty?
|
||||
puts "Address Range #{args[1]} does not exit for "<<
|
||||
"Virtual Network #{args[0]}"
|
||||
exit -1
|
||||
end
|
||||
|
||||
str = OpenNebulaHelper.update_template_helper(false, args[0], obj,
|
||||
args[2], "AR_POOL/AR[AR_ID=#{args[1]}]", false)
|
||||
args[2], "AR_POOL", false)
|
||||
|
||||
str[-1]=''
|
||||
str.gsub!(/AR_ID="\d+"\n/,'')
|
||||
str.gsub!(/^\s*(#|$)/,'')
|
||||
str.gsub!(/\n/,',')
|
||||
|
||||
obj.update_ar("AR = [AR_ID=#{args[1]},#{str}]")
|
||||
obj.update_ar(str)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -786,11 +786,14 @@ function updateVNetworkInfo(request,vn){
|
||||
$(this).addClass('markrowchecked');
|
||||
});
|
||||
|
||||
if (get_ar(vn_info, id).PARENT_NETWORK_AR_ID != undefined){
|
||||
if (get_ar(vn_info, id).PARENT_NETWORK_AR_ID != undefined &&
|
||||
get_ar(vn_info, id).PARENT_NETWORK_AR_ID.length > 0){
|
||||
|
||||
$("#update_ar_button", $("#vnet_info_panel")).prop("disabled", true);
|
||||
$("#update_ar_button", $("#vnet_info_panel")).addClass("has-tip");
|
||||
$("#update_ar_button", $("#vnet_info_panel")).attr("title", tr("This address range is a reservation"));
|
||||
} else{
|
||||
$("#update_ar_button", $("#vnet_info_panel")).attr("ar_id", id);
|
||||
$("#update_ar_button", $("#vnet_info_panel")).prop("disabled", false);
|
||||
$("#update_ar_button", $("#vnet_info_panel")).removeClass("has-tip");
|
||||
$("#update_ar_button", $("#vnet_info_panel")).removeAttr("title");
|
||||
|
||||
Reference in new issue
Block a user