diff --git a/install.sh b/install.sh index 21b87df93d..a70468097d 100755 --- a/install.sh +++ b/install.sh @@ -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 diff --git a/src/vnm_mad/remotes/elastic/remote_update_sg b/src/vnm_mad/remotes/elastic/remote_update_sg deleted file mode 100755 index 96b77ccc57..0000000000 --- a/src/vnm_mad/remotes/elastic/remote_update_sg +++ /dev/null @@ -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 diff --git a/src/vnm_mad/remotes/elastic/update_sg b/src/vnm_mad/remotes/elastic/update_sg index d3d3949c91..96b77ccc57 100755 --- a/src/vnm_mad/remotes/elastic/update_sg +++ b/src/vnm_mad/remotes/elastic/update_sg @@ -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