diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 6f260efad0..25ec7fe433 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -221,8 +221,12 @@ class VmmAction vnm = @vnm_src end - result, info = vnm.do_action(@id, step[:action], - :parameters => get_parameters(step[:parameters])) + params = get_parameters(step[:parameters]) + + result, info = vnm.do_action(@id, + step[:action], + :stdin => true, + :parameters => params) when :tm result, info = @tm.do_transfer_action(@id, step[:parameters]) diff --git a/src/vnm_mad/one_vnm.rb b/src/vnm_mad/one_vnm.rb index e7789fb4f2..3c5a8c8d5c 100644 --- a/src/vnm_mad/one_vnm.rb +++ b/src/vnm_mad/one_vnm.rb @@ -52,7 +52,7 @@ class VirtualNetworkDriver :parameters => nil }.merge(ops) - cmd_params = "#{@vm_encoded}" + cmd_params = '' cmd_params << " #{options[:parameters]}" if options[:parameters] result = RESULT[:success] @@ -66,7 +66,7 @@ class VirtualNetworkDriver elsif @ssh_stream != nil if options[:stdin] cmdin = "cat << EOT | #{cmd}" - stdin = "#{options[:stdin]}\nEOT\n" + stdin = "#{@vm_encoded}\nEOT\n" else cmdin = cmd stdin = nil diff --git a/src/vnm_mad/remotes/802.1Q/clean b/src/vnm_mad/remotes/802.1Q/clean index be6c1c80cb..42a02de43f 100755 --- a/src/vnm_mad/remotes/802.1Q/clean +++ b/src/vnm_mad/remotes/802.1Q/clean @@ -21,7 +21,7 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vlan_tag_driver' -template64 = ARGV[0] +template64 = STDIN.read deploy_id = nil xpath_filter = VLANTagDriver::XPATH_FILTER diff --git a/src/vnm_mad/remotes/802.1Q/post b/src/vnm_mad/remotes/802.1Q/post index 232c9126af..2f75209331 100755 --- a/src/vnm_mad/remotes/802.1Q/post +++ b/src/vnm_mad/remotes/802.1Q/post @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vlan_tag_driver' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = VLANTagDriver::XPATH_FILTER begin diff --git a/src/vnm_mad/remotes/802.1Q/pre b/src/vnm_mad/remotes/802.1Q/pre index 672d830f5e..d15f89ffbc 100755 --- a/src/vnm_mad/remotes/802.1Q/pre +++ b/src/vnm_mad/remotes/802.1Q/pre @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vlan_tag_driver' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = VLANTagDriver::XPATH_FILTER hm = VLANTagDriver.from_base64(template64, xpath_filter, deploy_id) diff --git a/src/vnm_mad/remotes/802.1Q/update_sg b/src/vnm_mad/remotes/802.1Q/update_sg index 3101e95eae..2fca83acae 100755 --- a/src/vnm_mad/remotes/802.1Q/update_sg +++ b/src/vnm_mad/remotes/802.1Q/update_sg @@ -22,8 +22,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vnmmad' require 'vlan_tag_driver' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = VLANTagDriver::XPATH_FILTER begin diff --git a/src/vnm_mad/remotes/bridge/clean b/src/vnm_mad/remotes/bridge/clean index 45aaba232d..aef983e8cd 100755 --- a/src/vnm_mad/remotes/bridge/clean +++ b/src/vnm_mad/remotes/bridge/clean @@ -21,7 +21,7 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vnmmad' -template64 = ARGV[0] +template64 = STDIN.read deploy_id = nil xpath_filter = "TEMPLATE/NIC[VN_MAD='bridge']" diff --git a/src/vnm_mad/remotes/bridge/pre b/src/vnm_mad/remotes/bridge/pre index b1c511c1ce..54ea3e4363 100755 --- a/src/vnm_mad/remotes/bridge/pre +++ b/src/vnm_mad/remotes/bridge/pre @@ -16,13 +16,13 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -$: << File.dirname(__FILE__) -$: << File.join(File.dirname(__FILE__), "..") +$LOAD_PATH << File.dirname(__FILE__) +$LOAD_PATH << File.join(File.dirname(__FILE__), '..') require 'vnmmad' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = "TEMPLATE/NIC[VN_MAD='bridge']" hm = VNMMAD::NoVLANDriver.from_base64(template64, xpath_filter, deploy_id) diff --git a/src/vnm_mad/remotes/ebtables/clean b/src/vnm_mad/remotes/ebtables/clean index f1cfb0402b..02e5073188 100755 --- a/src/vnm_mad/remotes/ebtables/clean +++ b/src/vnm_mad/remotes/ebtables/clean @@ -21,7 +21,7 @@ $: << File.join(File.dirname(__FILE__), "..") require 'Ebtables' -template64 = ARGV[0] +template64 = STDIN.read deploy_id = nil xpath_filter = EbtablesVLAN::XPATH_FILTER diff --git a/src/vnm_mad/remotes/ebtables/post b/src/vnm_mad/remotes/ebtables/post index b111949ee1..8150265040 100755 --- a/src/vnm_mad/remotes/ebtables/post +++ b/src/vnm_mad/remotes/ebtables/post @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'Ebtables' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = EbtablesVLAN::XPATH_FILTER onevlan = EbtablesVLAN.from_base64(template64, xpath_filter, deploy_id) diff --git a/src/vnm_mad/remotes/ebtables/pre b/src/vnm_mad/remotes/ebtables/pre index 2e69a98479..b65174c384 100755 --- a/src/vnm_mad/remotes/ebtables/pre +++ b/src/vnm_mad/remotes/ebtables/pre @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'Ebtables' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = EbtablesVLAN::XPATH_FILTER onevlan = EbtablesVLAN.from_base64(template64, xpath_filter, deploy_id) diff --git a/src/vnm_mad/remotes/ebtables/update_sg b/src/vnm_mad/remotes/ebtables/update_sg index 4bf2061148..eef45aaeff 100755 --- a/src/vnm_mad/remotes/ebtables/update_sg +++ b/src/vnm_mad/remotes/ebtables/update_sg @@ -22,8 +22,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vnmmad' require 'Ebtables' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = EbtablesVLAN::XPATH_FILTER begin diff --git a/src/vnm_mad/remotes/fw/clean b/src/vnm_mad/remotes/fw/clean index 8edb14275c..41386415cf 100755 --- a/src/vnm_mad/remotes/fw/clean +++ b/src/vnm_mad/remotes/fw/clean @@ -21,7 +21,7 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vnmmad' -template64 = ARGV[0] +template64 = STDIN.read deploy_id = nil xpath_filter = "TEMPLATE/NIC[VN_MAD='fw']" diff --git a/src/vnm_mad/remotes/fw/post b/src/vnm_mad/remotes/fw/post index 2b2c1144e4..726f1ab7ef 100755 --- a/src/vnm_mad/remotes/fw/post +++ b/src/vnm_mad/remotes/fw/post @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vnmmad' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = "TEMPLATE/NIC[VN_MAD='fw']" begin diff --git a/src/vnm_mad/remotes/fw/pre b/src/vnm_mad/remotes/fw/pre index 708c2ca168..58a65999d7 100755 --- a/src/vnm_mad/remotes/fw/pre +++ b/src/vnm_mad/remotes/fw/pre @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vnmmad' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = "TEMPLATE/NIC[VN_MAD='fw']" hm = VNMMAD::NoVLANDriver.from_base64(template64, xpath_filter, deploy_id) diff --git a/src/vnm_mad/remotes/fw/update_sg b/src/vnm_mad/remotes/fw/update_sg index 7676b4f015..4277d619fd 100755 --- a/src/vnm_mad/remotes/fw/update_sg +++ b/src/vnm_mad/remotes/fw/update_sg @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vnmmad' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = "TEMPLATE/NIC[VN_MAD='fw']" begin diff --git a/src/vnm_mad/remotes/ovswitch/clean b/src/vnm_mad/remotes/ovswitch/clean index a7194870d5..dc35a3f6ac 100755 --- a/src/vnm_mad/remotes/ovswitch/clean +++ b/src/vnm_mad/remotes/ovswitch/clean @@ -21,7 +21,7 @@ $: << File.join(File.dirname(__FILE__), "..") require 'OpenvSwitch' -template64 = ARGV[0] +template64 = STDIN.read deploy_id = nil xpath_filter = OpenvSwitchVLAN::XPATH_FILTER diff --git a/src/vnm_mad/remotes/ovswitch/post b/src/vnm_mad/remotes/ovswitch/post index b7f89b086b..a78b6953c2 100755 --- a/src/vnm_mad/remotes/ovswitch/post +++ b/src/vnm_mad/remotes/ovswitch/post @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'OpenvSwitch' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = OpenvSwitchVLAN::XPATH_FILTER ovs = OpenvSwitchVLAN.from_base64(template64, xpath_filter, deploy_id) diff --git a/src/vnm_mad/remotes/ovswitch/pre b/src/vnm_mad/remotes/ovswitch/pre index 854556373b..fcb00cf73c 100755 --- a/src/vnm_mad/remotes/ovswitch/pre +++ b/src/vnm_mad/remotes/ovswitch/pre @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'OpenvSwitch' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = OpenvSwitchVLAN::XPATH_FILTER ovs = OpenvSwitchVLAN.from_base64(template64, xpath_filter, deploy_id) diff --git a/src/vnm_mad/remotes/ovswitch_vxlan/clean b/src/vnm_mad/remotes/ovswitch_vxlan/clean index 6c0634472d..d805a239c5 100755 --- a/src/vnm_mad/remotes/ovswitch_vxlan/clean +++ b/src/vnm_mad/remotes/ovswitch_vxlan/clean @@ -21,7 +21,7 @@ $: << File.join(File.dirname(__FILE__), "..") require 'OpenvSwitchVXLAN' -template64 = ARGV[0] +template64 = STDIN.read deploy_id = nil xpath_filter = OpenvSwitchVXLAN::XPATH_FILTER diff --git a/src/vnm_mad/remotes/ovswitch_vxlan/post b/src/vnm_mad/remotes/ovswitch_vxlan/post index 99b0c06f46..6f5748590b 100755 --- a/src/vnm_mad/remotes/ovswitch_vxlan/post +++ b/src/vnm_mad/remotes/ovswitch_vxlan/post @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'OpenvSwitchVXLAN' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = OpenvSwitchVXLAN::XPATH_FILTER ovs = OpenvSwitchVXLAN.from_base64(template64, xpath_filter, deploy_id) diff --git a/src/vnm_mad/remotes/ovswitch_vxlan/pre b/src/vnm_mad/remotes/ovswitch_vxlan/pre index ef02a8a73a..b5a22c5cf4 100755 --- a/src/vnm_mad/remotes/ovswitch_vxlan/pre +++ b/src/vnm_mad/remotes/ovswitch_vxlan/pre @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'OpenvSwitchVXLAN' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = OpenvSwitchVXLAN::XPATH_FILTER ovs = OpenvSwitchVXLAN.from_base64(template64, xpath_filter, deploy_id) diff --git a/src/vnm_mad/remotes/vxlan/clean b/src/vnm_mad/remotes/vxlan/clean index 7f69550471..2444a9719e 100755 --- a/src/vnm_mad/remotes/vxlan/clean +++ b/src/vnm_mad/remotes/vxlan/clean @@ -21,7 +21,7 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vxlan_driver' -template64 = ARGV[0] +template64 = STDIN.read deploy_id = nil xpath_filter = VXLANDriver::XPATH_FILTER diff --git a/src/vnm_mad/remotes/vxlan/post b/src/vnm_mad/remotes/vxlan/post index 8938445110..487b76082a 100755 --- a/src/vnm_mad/remotes/vxlan/post +++ b/src/vnm_mad/remotes/vxlan/post @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vxlan_driver' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = VXLANDriver::XPATH_FILTER begin diff --git a/src/vnm_mad/remotes/vxlan/pre b/src/vnm_mad/remotes/vxlan/pre index aaf3e07ed9..2de93fb998 100755 --- a/src/vnm_mad/remotes/vxlan/pre +++ b/src/vnm_mad/remotes/vxlan/pre @@ -21,8 +21,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vxlan_driver' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = VXLANDriver::XPATH_FILTER diff --git a/src/vnm_mad/remotes/vxlan/update_sg b/src/vnm_mad/remotes/vxlan/update_sg index 51c228be4a..f4d786456d 100755 --- a/src/vnm_mad/remotes/vxlan/update_sg +++ b/src/vnm_mad/remotes/vxlan/update_sg @@ -22,8 +22,8 @@ $: << File.join(File.dirname(__FILE__), "..") require 'vnmmad' require 'vxlan_driver' -template64 = ARGV[0] -deploy_id = ARGV[1] +template64 = STDIN.read +deploy_id = ARGV[0] xpath_filter = VXLANDriver::XPATH_FILTER begin