mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
M #-: Minor Fix for NIC_ALIAS & Elastic
This commit is contained in:
parent
75d15a3ae9
commit
855bbab941
@ -100,9 +100,10 @@ class ElasticDriver < VNMMAD::VNMDriver
|
||||
|
||||
provider.deactivate(cmds, nic) if provider.respond_to? :deactivate
|
||||
|
||||
next if nic[:parent_nic] || nic[:conf][:keep_empty_bridge]
|
||||
|
||||
cmds.add :ip, "link delete #{nic[:bridge]} | true"
|
||||
# TODO: MUST check if bridge is empty. Move to remote_clean
|
||||
#next if nic[:parent_nic] || nic[:conf][:keep_empty_bridge]
|
||||
#
|
||||
#cmds.add :ip, "link delete #{nic[:bridge]} | true"
|
||||
end
|
||||
|
||||
cmds.run_remote(@ssh)
|
||||
|
@ -44,17 +44,14 @@ $LOAD_PATH << File.join(File.dirname(__FILE__), '..')
|
||||
require 'vnmmad'
|
||||
|
||||
template64 = STDIN.read
|
||||
deploy_id = ARGV[0]
|
||||
|
||||
deploy_id = ARGV[0]
|
||||
xpath = "TEMPLATE/NIC[VN_MAD='elastic']"
|
||||
|
||||
begin
|
||||
drv = VNMMAD::VLANDriver.from_base64(template64,
|
||||
"TEMPLATE/NIC[VN_MAD='elastic']",
|
||||
deploy_id)
|
||||
drv = VNMMAD::NoVLANDriver.from_base64(template64, xpath, deploy_id)
|
||||
|
||||
drv.create_bridges
|
||||
|
||||
drv.run_hooks(ARGV, template64)
|
||||
drv.run_hooks(ARGV, template64) if drv.activate == 0
|
||||
rescue StandardError => e
|
||||
OpenNebula.log_error(e.message)
|
||||
OpenNebula.log_error(e.backtrace)
|
||||
|
@ -71,11 +71,7 @@ module VNMMAD
|
||||
# Executes the given block on each NIC
|
||||
def process
|
||||
@vm.each_nic do |nic|
|
||||
add_nic_conf(nic)
|
||||
add_bridge_conf(nic)
|
||||
add_ovs_bridge_conf(nic)
|
||||
add_ip_link_conf(nic)
|
||||
|
||||
nic_confs(nic)
|
||||
yield(nic)
|
||||
end
|
||||
end
|
||||
@ -83,19 +79,23 @@ module VNMMAD
|
||||
# Executes the given block on each NIC
|
||||
def process_all
|
||||
@vm.each_nic do |nic|
|
||||
add_nic_conf(nic)
|
||||
add_bridge_conf(nic)
|
||||
add_ovs_bridge_conf(nic)
|
||||
add_ip_link_conf(nic)
|
||||
|
||||
nic_confs(nic)
|
||||
yield(nic)
|
||||
end
|
||||
|
||||
@vm.each_nic_alias do |nic|
|
||||
nic_confs(nic)
|
||||
yield(nic)
|
||||
end
|
||||
end
|
||||
|
||||
def nic_confs(nic)
|
||||
add_nic_conf(nic)
|
||||
add_bridge_conf(nic)
|
||||
add_ovs_bridge_conf(nic)
|
||||
add_ip_link_conf(nic)
|
||||
end
|
||||
|
||||
# Parse network configuration and add it to the nic
|
||||
def add_nic_conf(nic)
|
||||
return if nic[:conf] && nic[:conf].instance_of?(Hash)
|
||||
|
Loading…
x
Reference in New Issue
Block a user