Merge branch 'feature-5027'

This commit is contained in:
Ruben S. Montero committed 2017-02-22 19:15:45 +01:00
commit 40cfed8d5e
16 files changed
+1073 -353

No files matched your search

+2 -2
View File
@@ -169,7 +169,7 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
end
vm_nics.each do |nic|
["IP", "IP6_GLOBAL", "IP6_ULA",
["IP", "IP6_GLOBAL", "IP6_ULA", "IP6",
"VROUTER_IP", "VROUTER_IP6_GLOBAL", "VROUTER_IP6_ULA"].each do |attr|
if nic.has_key?(attr)
ips.push(nic[attr])
@@ -752,7 +752,7 @@ in the frontend machine.
next if nic.has_key?("CLI_DONE")
["IP6_LINK", "IP6_ULA", "IP6_GLOBAL"].each do |attr|
["IP6_LINK", "IP6_ULA", "IP6_GLOBAL", "IP6"].each do |attr|
if nic.has_key?(attr)
shown_ips << nic[attr]
+16 -3
View File
@@ -48,6 +48,14 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper
:description => "First IP address in . notation"
}
IP6 = {
:name => "ip6",
:short => "-6 ip6",
:large => "--ip6 ip6",
:format => String,
:description => "First IPv6 address in : notation"
}
SIZE = {
:name => "size",
:short => "-s size",
@@ -117,7 +125,8 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper
]
ADDAR_OPTIONS = [
SIZE, MAC, IP, IP6_GLOBAL, IP6_ULA, GATEWAY, NETMASK, VN_MAD, VLAN_ID ]
SIZE, MAC, IP, IP6, IP6_GLOBAL, IP6_ULA, GATEWAY, NETMASK, VN_MAD,
VLAN_ID ]
def self.rname
"VNET"
@@ -274,6 +283,10 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper
puts format % ["IP6_ULA", ar["IP6_ULA"], ar["IP6_ULA_END"]]
end
if !ar["IP6"].nil?
puts format % ["IP6", ar["IP6"], ar["IP6_END"]]
end
puts
end
@@ -325,8 +338,8 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper
d["IP"]||"-"
end
column :IP6_GLOBAL, "", :donottruncate, :size=>26 do |d|
d["IP6_GLOBAL"]||"-"
column :IP6, "", :donottruncate, :size=>26 do |d|
d["IP6"]||d["IP6_GLOBAL"]||"-"
end
end.show(leases, {})
+11 -6
View File
@@ -123,15 +123,17 @@ cmd=CommandParser::CmdParser.new(ARGV) do
if options[:ip]
if options[:ip6_global] || options[:ip6_ula]
ar << "TYPE=\"IP4_6\""
elsif options[:ip6]
ar << "TYPE=\"IP4_6_STATIC\""
else
ar << "TYPE=\"IP4\""
end
elsif options[:ip6]
ar << "TYPE=\"IP6_STATIC\""
elsif options[:ip6_global] || options[:ip6_ula]
ar << "TYPE=\"IP6\""
else
if options[:ip6_global] || options[:ip6_ula]
ar << "TYPE=\"IP6\""
else
ar << "TYPE=\"ETHER\""
end
ar << "TYPE=\"ETHER\""
end
if options[:size]
@@ -142,6 +144,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
end
ar << ", IP = " << options[:ip] if options[:ip]
ar << ", IP6 = " << options[:ip6] if options[:ip6]
ar << ", MAC = " << options[:mac] if options[:mac]
ar << ", GLOBAL_PREFIX = " <<
options[:ip6_global] if options[:ip6_global]
@@ -234,7 +237,8 @@ cmd=CommandParser::CmdParser.new(ARGV) do
command :reserve, reserve_desc, :vnetid, [:vnetid, nil],
:options=>STD_OPTIONS + [OneVNetHelper::AR, OneVNetHelper::NAME,
OneVNetHelper::SIZE, OneVNetHelper::MAC, OneVNetHelper::IP] do
OneVNetHelper::SIZE, OneVNetHelper::MAC, OneVNetHelper::IP,
OneVNetHelper::IP6 ] do
helper.perform_action(args[0],options,"reservation made") do |vn|
size = options[:size] || -1
name = options[:name] || -1
@@ -242,6 +246,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
addr = nil
addr = options[:mac] if options[:mac]
addr = options[:ip] if options[:ip]
addr = options[:ip6] if options[:ip6]
if size == -1
STDERR.puts "Specify a size (-s size) for the reservation"