diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 89e4759c0b9..383cc23e508 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -662,7 +662,7 @@ TM_MAD = [ DATASTORE_MAD = [ EXECUTABLE = "one_datastore", - ARGUMENTS = "-i -t 15 -d dummy,fs,lvm,ceph,dev,iscsi_libvirt,vcenter,restic,rsync -s shared,ssh,ceph,fs_lvm,fs_lvm_ssh,qcow2,vcenter" + ARGUMENTS = "-t 15 -d dummy,fs,lvm,ceph,dev,iscsi_libvirt,vcenter,restic,rsync -s shared,ssh,ceph,fs_lvm,fs_lvm_ssh,qcow2,vcenter" ] #******************************************************************************* diff --git a/src/datastore_mad/one_datastore.rb b/src/datastore_mad/one_datastore.rb index bbdfd105c87..79f4ba98e71 100755 --- a/src/datastore_mad/one_datastore.rb +++ b/src/datastore_mad/one_datastore.rb @@ -93,7 +93,6 @@ def initialize(ds_type, sys_ds_type, options = {}) :concurrency => 10, :threaded => true, :retries => 0, - :stdin => false, :local_actions => { ACTION[:stat] => nil, ACTION[:cp] => nil, @@ -236,15 +235,8 @@ def do_image_action(id, ds, action, stdin, sys = '', encode64 = false) path = File.join(@local_scripts_path, ds) end - if @options[:stdin] - arguments = " - #{id}" - else - arguments = " #{stdin} #{id}" - stdin = nil - end - cmd = File.join(path, ACTION[action].downcase) - cmd << arguments + cmd << " #{id}" rc = LocalCommand.run(cmd, log_method(id), stdin) @@ -287,15 +279,13 @@ def get_ds_type(drv_message) ['--threads', '-t', GetoptLong::OPTIONAL_ARGUMENT], ['--ds-types', '-d', GetoptLong::OPTIONAL_ARGUMENT], ['--system-ds-types', '-s', GetoptLong::OPTIONAL_ARGUMENT], - ['--timeout', '-w', GetoptLong::OPTIONAL_ARGUMENT], - ['--stdin', '-i', GetoptLong::NO_ARGUMENT] + ['--timeout', '-w', GetoptLong::OPTIONAL_ARGUMENT] ) ds_type = nil sys_ds_type = nil threads = 15 timeout = nil -stdin = false begin opts.each do |opt, arg| @@ -308,8 +298,6 @@ def get_ds_type(drv_message) sys_ds_type = arg.split(',').map {|a| a.strip } when '--timeout' timeout = arg.to_i - when '--stdin' - stdin = true end end rescue StandardError => _e @@ -318,6 +306,5 @@ def get_ds_type(drv_message) ds_driver = DatastoreDriver.new(ds_type, sys_ds_type, :concurrency => threads, - :timeout => timeout, - :stdin => stdin) + :timeout => timeout) ds_driver.start_driver diff --git a/src/datastore_mad/remotes/ceph/clone b/src/datastore_mad/remotes/ceph/clone index 5b52591a49d..554b113d6ce 100755 --- a/src/datastore_mad/remotes/ceph/clone +++ b/src/datastore_mad/remotes/ceph/clone @@ -35,12 +35,8 @@ source ${DRIVER_PATH}/../../etc/datastore/ceph/ceph.conf # -------- Get cp and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/ceph/cp b/src/datastore_mad/remotes/ceph/cp index 9b86cfaa582..e13e2596ca1 100755 --- a/src/datastore_mad/remotes/ceph/cp +++ b/src/datastore_mad/remotes/ceph/cp @@ -37,12 +37,8 @@ source ${DRIVER_PATH}/../../etc/datastore/ceph/ceph.conf # -------- Get cp and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 export DRV_ACTION diff --git a/src/datastore_mad/remotes/ceph/export b/src/datastore_mad/remotes/ceph/export index b2e4a92ea43..4863fd8372a 100755 --- a/src/datastore_mad/remotes/ceph/export +++ b/src/datastore_mad/remotes/ceph/export @@ -36,12 +36,8 @@ source ${DRIVER_PATH}/../../etc/datastore/ceph/ceph.conf # -------- Get rm and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/ceph/mkfs b/src/datastore_mad/remotes/ceph/mkfs index 6955e505a28..f3210e703cd 100755 --- a/src/datastore_mad/remotes/ceph/mkfs +++ b/src/datastore_mad/remotes/ceph/mkfs @@ -38,12 +38,8 @@ source ${DRIVER_PATH}/../../etc/datastore/datastore.conf # -------- Get mkfs and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/ceph/monitor b/src/datastore_mad/remotes/ceph/monitor index e134b1ca2ad..c9b56fa7e8f 100755 --- a/src/datastore_mad/remotes/ceph/monitor +++ b/src/datastore_mad/remotes/ceph/monitor @@ -37,12 +37,8 @@ source ${DRIVER_PATH}/ceph_utils.sh # -------- Get datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/ceph/rm b/src/datastore_mad/remotes/ceph/rm index 2b26538930f..2ac413dbad7 100755 --- a/src/datastore_mad/remotes/ceph/rm +++ b/src/datastore_mad/remotes/ceph/rm @@ -37,12 +37,8 @@ source ${DRIVER_PATH}/../../etc/datastore/ceph/ceph.conf # -------- Get rm and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/ceph/snap_delete b/src/datastore_mad/remotes/ceph/snap_delete index fe4bc5dcee4..7f982cc025c 100755 --- a/src/datastore_mad/remotes/ceph/snap_delete +++ b/src/datastore_mad/remotes/ceph/snap_delete @@ -38,12 +38,8 @@ source ${DRIVER_PATH}/../../etc/datastore/ceph/ceph.conf # -------- Get image and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/ceph/snap_flatten b/src/datastore_mad/remotes/ceph/snap_flatten index 424d2e2c6bb..d5d8a407549 100755 --- a/src/datastore_mad/remotes/ceph/snap_flatten +++ b/src/datastore_mad/remotes/ceph/snap_flatten @@ -38,12 +38,8 @@ source ${DRIVER_PATH}/../../etc/datastore/ceph/ceph.conf # -------- Get image and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/ceph/snap_revert b/src/datastore_mad/remotes/ceph/snap_revert index 5c1ec5c3e0b..5640c9fb184 100755 --- a/src/datastore_mad/remotes/ceph/snap_revert +++ b/src/datastore_mad/remotes/ceph/snap_revert @@ -38,12 +38,8 @@ source ${DRIVER_PATH}/../../etc/datastore/ceph/ceph.conf # -------- Get image and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/common/stat b/src/datastore_mad/remotes/common/stat index 7218096c786..6861e8212cf 100755 --- a/src/datastore_mad/remotes/common/stat +++ b/src/datastore_mad/remotes/common/stat @@ -36,12 +36,8 @@ source ${DRIVER_PATH}/../libfs.sh # -------- Get stat and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/dev/cp b/src/datastore_mad/remotes/dev/cp index 62c30b9d3f5..22baec9243c 100755 --- a/src/datastore_mad/remotes/dev/cp +++ b/src/datastore_mad/remotes/dev/cp @@ -36,12 +36,8 @@ source ${DRIVER_PATH}/../libfs.sh # -------- Get cp and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 export DRV_ACTION diff --git a/src/datastore_mad/remotes/fs/clone b/src/datastore_mad/remotes/fs/clone index d6ad63a0358..913a1733296 100755 --- a/src/datastore_mad/remotes/fs/clone +++ b/src/datastore_mad/remotes/fs/clone @@ -36,12 +36,8 @@ source ${DRIVER_PATH}/../libfs.sh # -------- Get cp and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/fs/cp b/src/datastore_mad/remotes/fs/cp index 4e4c2868faa..2fbb57febe7 100755 --- a/src/datastore_mad/remotes/fs/cp +++ b/src/datastore_mad/remotes/fs/cp @@ -37,12 +37,8 @@ source ${DRIVER_PATH}/../../etc/datastore/fs/fs.conf # -------- Get cp and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 export DRV_ACTION diff --git a/src/datastore_mad/remotes/fs/export b/src/datastore_mad/remotes/fs/export index e91f8255f5a..868336ea947 100755 --- a/src/datastore_mad/remotes/fs/export +++ b/src/datastore_mad/remotes/fs/export @@ -35,12 +35,8 @@ source ${DRIVER_PATH}/../libfs.sh # -------- Get rm and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/fs/mkfs b/src/datastore_mad/remotes/fs/mkfs index 6b04ab4c2ee..c6cb1f6ec8f 100755 --- a/src/datastore_mad/remotes/fs/mkfs +++ b/src/datastore_mad/remotes/fs/mkfs @@ -37,12 +37,8 @@ source ${DRIVER_PATH}/../../etc/datastore/datastore.conf # -------- Get mkfs and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/fs/monitor b/src/datastore_mad/remotes/fs/monitor index 912a28808ff..5e1a30bc856 100755 --- a/src/datastore_mad/remotes/fs/monitor +++ b/src/datastore_mad/remotes/fs/monitor @@ -35,12 +35,8 @@ source ${DRIVER_PATH}/../libfs.sh # -------- Get datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/fs/rm b/src/datastore_mad/remotes/fs/rm index 42af14c7a13..e48e7014b84 100755 --- a/src/datastore_mad/remotes/fs/rm +++ b/src/datastore_mad/remotes/fs/rm @@ -35,12 +35,8 @@ source ${DRIVER_PATH}/../libfs.sh # -------- Get rm and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/fs/snap_delete b/src/datastore_mad/remotes/fs/snap_delete index f4517cf9269..138d28233ca 100755 --- a/src/datastore_mad/remotes/fs/snap_delete +++ b/src/datastore_mad/remotes/fs/snap_delete @@ -32,12 +32,8 @@ source ${DRIVER_PATH}/../libfs.sh # -------- Get image and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/fs/snap_flatten b/src/datastore_mad/remotes/fs/snap_flatten index 7a0d9ea4f8e..461e41b9174 100755 --- a/src/datastore_mad/remotes/fs/snap_flatten +++ b/src/datastore_mad/remotes/fs/snap_flatten @@ -28,12 +28,8 @@ source ${DRIVER_PATH}/../libfs.sh # -------- Get image and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/fs/snap_revert b/src/datastore_mad/remotes/fs/snap_revert index f3b942f9279..9507651bc55 100755 --- a/src/datastore_mad/remotes/fs/snap_revert +++ b/src/datastore_mad/remotes/fs/snap_revert @@ -32,12 +32,8 @@ source ${DRIVER_PATH}/../libfs.sh # -------- Get image and datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/rsync/increment_flatten b/src/datastore_mad/remotes/rsync/increment_flatten index 0c2e352a689..667c76cc388 100755 --- a/src/datastore_mad/remotes/rsync/increment_flatten +++ b/src/datastore_mad/remotes/rsync/increment_flatten @@ -58,8 +58,7 @@ require 'rexml/document' require_relative '../../tm/lib/backup' require_relative '../../tm/lib/tm_action' -daction64 = ARGV[0] -daction64 = STDIN.read if daction64 == '-' +daction64 = STDIN.read # Parse input data. diff --git a/src/datastore_mad/remotes/rsync/monitor b/src/datastore_mad/remotes/rsync/monitor index 20bcecd6f61..7ca6d3b47de 100755 --- a/src/datastore_mad/remotes/rsync/monitor +++ b/src/datastore_mad/remotes/rsync/monitor @@ -31,12 +31,8 @@ source ${DRIVER_PATH}/../libfs.sh # -------- Get datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" diff --git a/src/datastore_mad/remotes/rsync/restore b/src/datastore_mad/remotes/rsync/restore index 5b9fb96fd42..cc568321be8 100755 --- a/src/datastore_mad/remotes/rsync/restore +++ b/src/datastore_mad/remotes/rsync/restore @@ -69,10 +69,8 @@ require_relative '../../tm/lib/tm_action' # - vm.xml description # - list of disks in the backup # ------------------------------------------------------------------------------ -daction64 = ARGV[0] -daction64 = STDIN.read if daction64 == '-' - -_request_id = ARGV[1] +daction64 = STDIN.read +_request_id = ARGV[0] begin action = Base64.decode64 daction64 diff --git a/src/datastore_mad/remotes/rsync/rm b/src/datastore_mad/remotes/rsync/rm index ddb2e5d82e0..de46f4ec6b9 100755 --- a/src/datastore_mad/remotes/rsync/rm +++ b/src/datastore_mad/remotes/rsync/rm @@ -58,8 +58,7 @@ require 'rexml/document' require_relative '../../tm/lib/backup' require_relative '../../tm/lib/tm_action' -daction64 = ARGV[0] -daction64 = STDIN.read if daction64 == '-' +daction64 = STDIN.read # Parse input data. diff --git a/src/datastore_mad/remotes/rsync/stat b/src/datastore_mad/remotes/rsync/stat index 5e1f8813d70..b1546d962b2 100755 --- a/src/datastore_mad/remotes/rsync/stat +++ b/src/datastore_mad/remotes/rsync/stat @@ -57,10 +57,8 @@ require 'base64' require_relative '../../tm/lib/tm_action' -daction64 = ARGV[0] -daction64 = STDIN.read if daction64 == '-' - -_ds_id = ARGV[1] +daction64 = STDIN.read +_ds_id = ARGV[0] # Image path in the form: # rsync://100/0:6da1c7,1:06132a,2:03fc2a//var/lib/one//datastores/100/13/6da1c7/disk.0.0 diff --git a/src/datastore_mad/remotes/vcenter/clone b/src/datastore_mad/remotes/vcenter/clone index 18845b56d2f..8586769fc20 100755 --- a/src/datastore_mad/remotes/vcenter/clone +++ b/src/datastore_mad/remotes/vcenter/clone @@ -51,9 +51,8 @@ $LOAD_PATH << File.dirname(__FILE__) require 'vcenter_driver' -drv_action_enc = ARGV[0] -id = ARGV[1] -drv_action_enc = STDIN.read if drv_action_enc == '-' +id = ARGV[0] +drv_action_enc = STDIN.read DRV_ACTION_DS = '/DS_DRIVER_ACTION_DATA/DATASTORE/' diff --git a/src/datastore_mad/remotes/vcenter/cp b/src/datastore_mad/remotes/vcenter/cp index 40eb4e34205..3c377d52dfc 100755 --- a/src/datastore_mad/remotes/vcenter/cp +++ b/src/datastore_mad/remotes/vcenter/cp @@ -125,9 +125,8 @@ def find_image_type(target_file) target_file_type end -drv_action_enc = ARGV[0] -id = ARGV[1] -drv_action_enc = STDIN.read if drv_action_enc == '-' +id = ARGV[0] +drv_action_enc = STDIN.read drv_action = OpenNebula::XMLElement.new drv_action.initialize_xml(Base64.decode64(drv_action_enc), diff --git a/src/datastore_mad/remotes/vcenter/export b/src/datastore_mad/remotes/vcenter/export index 24b177669ed..864cf0124c4 100755 --- a/src/datastore_mad/remotes/vcenter/export +++ b/src/datastore_mad/remotes/vcenter/export @@ -55,8 +55,7 @@ $LOAD_PATH << File.dirname(__FILE__) require 'opennebula' -drv_action_enc = ARGV[0] -drv_action_enc = STDIN.read if drv_action_enc == '-' +drv_action_enc = STDIN.read drv_action = OpenNebula::XMLElement.new drv_action.initialize_xml(Base64.decode64(drv_action_enc), diff --git a/src/datastore_mad/remotes/vcenter/mkfs b/src/datastore_mad/remotes/vcenter/mkfs index ce90f2bda36..9692dfc8e2b 100755 --- a/src/datastore_mad/remotes/vcenter/mkfs +++ b/src/datastore_mad/remotes/vcenter/mkfs @@ -55,8 +55,7 @@ $LOAD_PATH << File.dirname(__FILE__) require 'vcenter_driver' -drv_action_enc = ARGV[0] -drv_action_enc = STDIN.read if drv_action_enc == '-' +drv_action_enc = STDIN.read drv_action = OpenNebula::XMLElement.new drv_action.initialize_xml(Base64.decode64(drv_action_enc), diff --git a/src/datastore_mad/remotes/vcenter/monitor b/src/datastore_mad/remotes/vcenter/monitor index 469f9fbf878..61568997d41 100755 --- a/src/datastore_mad/remotes/vcenter/monitor +++ b/src/datastore_mad/remotes/vcenter/monitor @@ -59,9 +59,8 @@ def not_dsid_or_dsref_valid?(ds_id, ds_ref) ds_id.nil? || ds_ref.nil? end -drv_action_enc = ARGV[0] -id = ARGV[1] -drv_action_enc = STDIN.read if drv_action_enc == '-' +id = ARGV[0] +drv_action_enc = STDIN.read drv_action = OpenNebula::XMLElement.new drv_action.initialize_xml(Base64.decode64(drv_action_enc), diff --git a/src/datastore_mad/remotes/vcenter/rm b/src/datastore_mad/remotes/vcenter/rm index 646d807cd3d..c2efd713c0a 100755 --- a/src/datastore_mad/remotes/vcenter/rm +++ b/src/datastore_mad/remotes/vcenter/rm @@ -59,8 +59,7 @@ def img_not_imported?(imported) imported.nil? || imported.empty? end -drv_action_enc = ARGV[0] -drv_action_enc = STDIN.read if drv_action_enc == '-' +drv_action_enc = STDIN.read drv_action =OpenNebula::XMLElement.new drv_action.initialize_xml(Base64.decode64(drv_action_enc), diff --git a/src/datastore_mad/remotes/vcenter/stat b/src/datastore_mad/remotes/vcenter/stat index 10f8f0508bf..136a576a72f 100755 --- a/src/datastore_mad/remotes/vcenter/stat +++ b/src/datastore_mad/remotes/vcenter/stat @@ -55,8 +55,7 @@ $LOAD_PATH << File.dirname(__FILE__) require 'vcenter_driver' -drv_action_enc = ARGV[0] -drv_action_enc = STDIN.read if drv_action_enc == '-' +drv_action_enc = STDIN.read drv_action =OpenNebula::XMLElement.new drv_action.initialize_xml(Base64.decode64(drv_action_enc), diff --git a/src/market_mad/one_market.rb b/src/market_mad/one_market.rb index 7e07a67be90..aa19c6c17ad 100755 --- a/src/market_mad/one_market.rb +++ b/src/market_mad/one_market.rb @@ -300,7 +300,7 @@ def do_action(id, market, datastore, action, drv_action, encode, stdin) end if stdin - arguments = " - #{id}" + arguments = " #{id}" else arguments = " #{drv_action} #{id}" drv_action = nil @@ -347,14 +347,12 @@ def failure(asym, id, message) ['--threads', '-t', GetoptLong::OPTIONAL_ARGUMENT], ['--market-types', '-m', GetoptLong::OPTIONAL_ARGUMENT], ['--timeout', '-w', GetoptLong::OPTIONAL_ARGUMENT], - ['--proxy', '-p', GetoptLong::OPTIONAL_ARGUMENT], - ['--stdin', '-i', GetoptLong::NO_ARGUMENT] + ['--proxy', '-p', GetoptLong::OPTIONAL_ARGUMENT] ) mp_type = nil threads = 15 timeout = nil -stdin = false begin opts.each do |opt, arg| @@ -367,8 +365,6 @@ def failure(asym, id, message) timeout = arg.to_i when '--proxy' ENV['http_proxy'] = arg - when '--stdin' - stdin = true end end rescue StandardError @@ -377,7 +373,5 @@ def failure(asym, id, message) mp_driver = MarketPlaceDriver.new(mp_type, :concurrency => threads, - :timeout => timeout, - :stdin => stdin) + :timeout => timeout) mp_driver.start_driver - diff --git a/src/tm_mad/ceph/monitor b/src/tm_mad/ceph/monitor index aa83e7e4507..d92617760ac 100755 --- a/src/tm_mad/ceph/monitor +++ b/src/tm_mad/ceph/monitor @@ -37,12 +37,8 @@ source ${DRIVER_PATH}/../../datastore/ceph/ceph_utils.sh # -------- Get datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +ID=$1 XPATH="${DRIVER_PATH}/../../datastore/xpath.rb -b $DRV_ACTION" diff --git a/src/tm_mad/fs_lvm/monitor b/src/tm_mad/fs_lvm/monitor index 6c7a7a14178..bb068b90ff2 100755 --- a/src/tm_mad/fs_lvm/monitor +++ b/src/tm_mad/fs_lvm/monitor @@ -35,12 +35,8 @@ source ${DRIVER_PATH}/../../datastore/libfs.sh # -------- Get datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -DS_ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +DS_ID=$1 XPATH="${DRIVER_PATH}/../../datastore/xpath.rb -b $DRV_ACTION" diff --git a/src/tm_mad/qcow2/monitor b/src/tm_mad/qcow2/monitor index fe8121a9a75..b7616200566 100755 --- a/src/tm_mad/qcow2/monitor +++ b/src/tm_mad/qcow2/monitor @@ -35,12 +35,8 @@ source ${DRIVER_PATH}/../../datastore/libfs.sh # -------- Get datastore arguments from OpenNebula core ------------ -DRV_ACTION=$1 -DS_ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi +DRV_ACTION=`cat -` +DS_ID=$1 XPATH="${DRIVER_PATH}/../../datastore/xpath.rb -b $DRV_ACTION"