From 5a8bec5168963d5e1b61112a664c1bd4d0f288e1 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 28 Mar 2023 09:29:48 +0200 Subject: [PATCH] B #6162: Fix duplicated argument parsing in snap actions --- src/datastore_mad/remotes/fs/snap_delete | 4 ---- src/datastore_mad/remotes/fs/snap_flatten | 12 ++++-------- src/datastore_mad/remotes/fs/snap_revert | 12 ++++-------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/datastore_mad/remotes/fs/snap_delete b/src/datastore_mad/remotes/fs/snap_delete index bb0f346706..f4517cf926 100755 --- a/src/datastore_mad/remotes/fs/snap_delete +++ b/src/datastore_mad/remotes/fs/snap_delete @@ -15,10 +15,6 @@ # See the License for the specific language governing permissions and # # limitations under the License. # #--------------------------------------------------------------------------- # - -DRV_ACTION=$1 -ID=$2 - if [ -z "${ONE_LOCATION}" ]; then TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh DATASTORES=/var/lib/one/datastores diff --git a/src/datastore_mad/remotes/fs/snap_flatten b/src/datastore_mad/remotes/fs/snap_flatten index 006fd3748f..7a0d9ea4f8 100755 --- a/src/datastore_mad/remotes/fs/snap_flatten +++ b/src/datastore_mad/remotes/fs/snap_flatten @@ -15,14 +15,6 @@ # See the License for the specific language governing permissions and # # limitations under the License. # #--------------------------------------------------------------------------- # - -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi - if [ -z "${ONE_LOCATION}" ]; then TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh else @@ -39,6 +31,10 @@ source ${DRIVER_PATH}/../libfs.sh DRV_ACTION=$1 ID=$2 +if [ "${DRV_ACTION}" = "-" ]; then + DRV_ACTION=`cat -` +fi + XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" unset i j XPATH_ELEMENTS diff --git a/src/datastore_mad/remotes/fs/snap_revert b/src/datastore_mad/remotes/fs/snap_revert index 9ec81afa80..f3b942f927 100755 --- a/src/datastore_mad/remotes/fs/snap_revert +++ b/src/datastore_mad/remotes/fs/snap_revert @@ -15,14 +15,6 @@ # See the License for the specific language governing permissions and # # limitations under the License. # #--------------------------------------------------------------------------- # - -DRV_ACTION=$1 -ID=$2 - -if [ "${DRV_ACTION}" = "-" ]; then - DRV_ACTION=`cat -` -fi - if [ -z "${ONE_LOCATION}" ]; then TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh DATASTORES=/var/lib/one/datastores @@ -43,6 +35,10 @@ source ${DRIVER_PATH}/../libfs.sh DRV_ACTION=$1 ID=$2 +if [ "${DRV_ACTION}" = "-" ]; then + DRV_ACTION=`cat -` +fi + XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" unset i j XPATH_ELEMENTS