1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-13 13:17:39 +03:00

M #-: update_sg is already remote (#1088)

This commit is contained in:
Jan Orel 2021-04-12 09:38:44 +02:00 committed by GitHub
parent a6bbf31d0b
commit 16ff61ca03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 53 deletions

View File

@ -1738,8 +1738,7 @@ NETWORK_ELASTIC_FILES="src/vnm_mad/remotes/elastic/elastic.rb \
src/vnm_mad/remotes/elastic/post \
src/vnm_mad/remotes/elastic/remote_post \
src/vnm_mad/remotes/elastic/pre \
src/vnm_mad/remotes/elastic/update_sg \
src/vnm_mad/remotes/elastic/remote_update_sg "
src/vnm_mad/remotes/elastic/update_sg"
#-------------------------------------------------------------------------------
# Virtual Network Manager drivers configuration to be installed under $REMOTES_LOCATION/etc/vnm

View File

@ -1,38 +0,0 @@
#!/usr/bin/env ruby
# -------------------------------------------------------------------------- #
# Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
$: << File.dirname(__FILE__)
$: << File.join(File.dirname(__FILE__), "..")
require 'vnmmad'
template64 = STDIN.read
deploy_id = ARGV[0]
xpath_filter = "TEMPLATE/NIC[VN_MAD='elastic']"
begin
filter_driver = VNMMAD::VNMDriver.filter_driver(template64,
xpath_filter,
deploy_id,
false)
filter_driver.activate(true)
rescue Exception => e
OpenNebula.log_error(e.message)
OpenNebula.log_error(e.backtrace)
exit 1
end

View File

@ -16,24 +16,22 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
$LOAD_PATH << File.dirname(__FILE__)
$LOAD_PATH << File.join(File.dirname(__FILE__), '..')
$: << File.dirname(__FILE__)
$: << File.join(File.dirname(__FILE__), "..")
require 'vnmmad'
template64 = STDIN.read
deploy_id = ARGV[0]
hostname = ARGV[1]
update_sg ="/var/tmp/one/vnm/elastic/remote_update_sg #{deploy_id} #{hostname}"
template64 = STDIN.read
deploy_id = ARGV[0]
xpath_filter = "TEMPLATE/NIC[VN_MAD='elastic']"
begin
rc = SSHCommand.run(update_sg, hostname, nil, template64)
raise rc.stderr unless rc.code == 0
rescue StandardError => e
filter_driver = VNMMAD::VNMDriver.filter_driver(template64,
xpath_filter,
deploy_id,
false)
filter_driver.activate(true)
rescue Exception => e
OpenNebula.log_error(e.message)
OpenNebula.log_error(e.backtrace)
exit 1