mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-25 23:21:29 +03:00
bug #1948: Get rid of umask. Now it must be configured in the oneadmin account
This commit is contained in:
parent
be7b5e4728
commit
6037a617d0
@ -45,7 +45,6 @@ unset i XPATH_ELEMENTS
|
||||
while IFS= read -r -d '' element; do
|
||||
XPATH_ELEMENTS[i++]="$element"
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/POOL_NAME \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/PATH \
|
||||
@ -54,7 +53,6 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
unset i
|
||||
|
||||
BASE_PATH="${XPATH_ELEMENTS[i++]}"
|
||||
UMASK="${XPATH_ELEMENTS[i++]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[i++]:-$HOST}"
|
||||
POOL_NAME="${XPATH_ELEMENTS[i++]:-$POOL_NAME}"
|
||||
SRC="${XPATH_ELEMENTS[i++]}"
|
||||
|
@ -51,7 +51,6 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/POOL_NAME \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/STAGING_DIR \
|
||||
@ -67,7 +66,6 @@ unset i
|
||||
BASE_PATH="${XPATH_ELEMENTS[i++]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[i++]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[i++]}"
|
||||
UMASK="${XPATH_ELEMENTS[i++]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[i++]:-$HOST}"
|
||||
POOL_NAME="${XPATH_ELEMENTS[i++]:-$POOL_NAME}"
|
||||
STAGING_DIR="${XPATH_ELEMENTS[i++]:-$STAGING_DIR}"
|
||||
@ -78,7 +76,7 @@ SHA1="${XPATH_ELEMENTS[i++]}"
|
||||
NO_DECOMPRESS="${XPATH_ELEMENTS[i++]}"
|
||||
LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[i++]}"
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
IMAGE_HASH=`generate_image_hash`
|
||||
TMP_DST="$STAGING_DIR/$IMAGE_HASH"
|
||||
|
@ -49,7 +49,6 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/POOL_NAME \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/STAGING_DIR \
|
||||
@ -61,14 +60,13 @@ unset i
|
||||
BASE_PATH="${XPATH_ELEMENTS[i++]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[i++]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[i++]}"
|
||||
UMASK="${XPATH_ELEMENTS[i++]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[i++]:-$HOST}"
|
||||
POOL_NAME="${XPATH_ELEMENTS[i++]:-$POOL_NAME}"
|
||||
STAGING_DIR="${XPATH_ELEMENTS[i++]:-$STAGING_DIR}"
|
||||
FSTYPE="${XPATH_ELEMENTS[i++]}"
|
||||
SIZE="${XPATH_ELEMENTS[i++]}"
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
IMAGE_HASH=`generate_image_hash`
|
||||
TMP_DST="$STAGING_DIR/$IMAGE_HASH"
|
||||
|
@ -46,17 +46,15 @@ unset i XPATH_ELEMENTS
|
||||
while IFS= read -r -d '' element; do
|
||||
XPATH_ELEMENTS[i++]="$element"
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/DS_MAD \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/PATH)
|
||||
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
UMASK="${XPATH_ELEMENTS[1]}"
|
||||
DS_MAD="${XPATH_ELEMENTS[2]}"
|
||||
SRC="${XPATH_ELEMENTS[3]}"
|
||||
DS_MAD="${XPATH_ELEMENTS[1]}"
|
||||
SRC="${XPATH_ELEMENTS[2]}"
|
||||
|
||||
mkdir -p "$BASE_PATH"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
DST=`generate_image_path`
|
||||
|
||||
|
@ -50,7 +50,6 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/PATH \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/TEMPLATE/MD5 \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/TEMPLATE/SHA1 \
|
||||
@ -60,16 +59,15 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[1]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[2]}"
|
||||
UMASK="${XPATH_ELEMENTS[3]}"
|
||||
SRC="${XPATH_ELEMENTS[4]}"
|
||||
MD5="${XPATH_ELEMENTS[5]}"
|
||||
SHA1="${XPATH_ELEMENTS[6]}"
|
||||
NO_DECOMPRESS="${XPATH_ELEMENTS[7]}"
|
||||
LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[8]}"
|
||||
SRC="${XPATH_ELEMENTS[3]}"
|
||||
MD5="${XPATH_ELEMENTS[4]}"
|
||||
SHA1="${XPATH_ELEMENTS[5]}"
|
||||
NO_DECOMPRESS="${XPATH_ELEMENTS[6]}"
|
||||
LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[7]}"
|
||||
|
||||
mkdir -p "$BASE_PATH"
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
DST=`generate_image_path`
|
||||
|
||||
|
@ -48,7 +48,6 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/FSTYPE \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/SIZE)
|
||||
|
||||
@ -56,12 +55,11 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[1]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[2]}"
|
||||
UMASK="${XPATH_ELEMENTS[3]}"
|
||||
FSTYPE="${XPATH_ELEMENTS[4]}"
|
||||
SIZE="${XPATH_ELEMENTS[5]}"
|
||||
FSTYPE="${XPATH_ELEMENTS[3]}"
|
||||
SIZE="${XPATH_ELEMENTS[4]}"
|
||||
|
||||
mkdir -p "$BASE_PATH"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
DST=`generate_image_path`
|
||||
|
||||
|
@ -47,7 +47,6 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_IQN \
|
||||
@ -57,17 +56,16 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[1]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[2]}"
|
||||
UMASK="${XPATH_ELEMENTS[3]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[4]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[5]:-$VG_NAME}"
|
||||
BASE_IQN="${XPATH_ELEMENTS[6]:-$BASE_IQN}"
|
||||
SRC="${XPATH_ELEMENTS[7]}"
|
||||
SIZE="${XPATH_ELEMENTS[8]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[3]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[4]:-$VG_NAME}"
|
||||
BASE_IQN="${XPATH_ELEMENTS[5]:-$BASE_IQN}"
|
||||
SRC="${XPATH_ELEMENTS[6]}"
|
||||
SIZE="${XPATH_ELEMENTS[7]}"
|
||||
|
||||
# Check if 'TGTSETUPLUN' is installed
|
||||
tgt_setup_lun_install "$DST_HOST" "$BASE_PATH"
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
LV_NAME="lv-one-${ID}"
|
||||
IQN="$BASE_IQN:$DST_HOST.$VG_NAME.$LV_NAME"
|
||||
|
@ -51,7 +51,6 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_IQN \
|
||||
@ -65,21 +64,20 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[1]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[2]}"
|
||||
UMASK="${XPATH_ELEMENTS[3]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[4]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[5]:-$VG_NAME}"
|
||||
BASE_IQN="${XPATH_ELEMENTS[6]:-$BASE_IQN}"
|
||||
SRC="${XPATH_ELEMENTS[7]}"
|
||||
SIZE="${XPATH_ELEMENTS[8]}"
|
||||
MD5="${XPATH_ELEMENTS[9]}"
|
||||
SHA1="${XPATH_ELEMENTS[10]}"
|
||||
NO_DECOMPRESS="${XPATH_ELEMENTS[11]}"
|
||||
LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[12]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[3]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[4]:-$VG_NAME}"
|
||||
BASE_IQN="${XPATH_ELEMENTS[5]:-$BASE_IQN}"
|
||||
SRC="${XPATH_ELEMENTS[6]}"
|
||||
SIZE="${XPATH_ELEMENTS[7]}"
|
||||
MD5="${XPATH_ELEMENTS[8]}"
|
||||
SHA1="${XPATH_ELEMENTS[9]}"
|
||||
NO_DECOMPRESS="${XPATH_ELEMENTS[10]}"
|
||||
LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[11]}"
|
||||
|
||||
# Check if 'TGTSETUPLUN' is installed
|
||||
tgt_setup_lun_install "$DST_HOST" "$BASE_PATH"
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
LV_NAME="lv-one-${ID}"
|
||||
IQN="$BASE_IQN:$DST_HOST.$VG_NAME.$LV_NAME"
|
||||
|
@ -49,7 +49,6 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_IQN \
|
||||
@ -59,17 +58,16 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[1]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[2]}"
|
||||
UMASK="${XPATH_ELEMENTS[3]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[4]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[5]:-$VG_NAME}"
|
||||
BASE_IQN="${XPATH_ELEMENTS[6]:-$BASE_IQN}"
|
||||
FSTYPE="${XPATH_ELEMENTS[7]}"
|
||||
SIZE="${XPATH_ELEMENTS[8]:-0}"
|
||||
DST_HOST="${XPATH_ELEMENTS[3]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[4]:-$VG_NAME}"
|
||||
BASE_IQN="${XPATH_ELEMENTS[5]:-$BASE_IQN}"
|
||||
FSTYPE="${XPATH_ELEMENTS[6]}"
|
||||
SIZE="${XPATH_ELEMENTS[7]:-0}"
|
||||
|
||||
# Check if 'TGTSETUPLUN' is installed
|
||||
tgt_setup_lun_install "$DST_HOST" "$BASE_PATH"
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
LV_NAME="lv-one-${ID}"
|
||||
IQN="$BASE_IQN:$DST_HOST.$VG_NAME.$LV_NAME"
|
||||
|
@ -21,7 +21,6 @@
|
||||
# @param $1 - Datastore base_path
|
||||
# @param $2 - Restricted directories
|
||||
# @param $3 - Safe dirs
|
||||
# @param $4 - Umask for new file creation (default: 0007)
|
||||
# @return sets the following environment variables
|
||||
# - RESTRICTED_DIRS: Paths that cannot be used to register images
|
||||
# - SAFE_DIRS: Paths that are safe to specify image paths
|
||||
@ -34,7 +33,6 @@ function set_up_datastore {
|
||||
BASE_PATH="$1"
|
||||
RESTRICTED_DIRS="$2"
|
||||
SAFE_DIRS="$3"
|
||||
UMASK="$4"
|
||||
|
||||
if [ -z "${ONE_LOCATION}" ]; then
|
||||
VAR_LOCATION=/var/lib/one/
|
||||
@ -52,12 +50,6 @@ function set_up_datastore {
|
||||
export BASE_PATH
|
||||
export RESTRICTED_DIRS
|
||||
export SAFE_DIRS
|
||||
|
||||
if [ -n "$UMASK" ]; then
|
||||
umask $UMASK
|
||||
else
|
||||
umask 0007
|
||||
fi
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
@ -45,18 +45,16 @@ unset i XPATH_ELEMENTS
|
||||
while IFS= read -r -d '' element; do
|
||||
XPATH_ELEMENTS[i++]="$element"
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/PATH \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/SIZE)
|
||||
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
UMASK="${XPATH_ELEMENTS[1]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[2]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[3]:-$VG_NAME}"
|
||||
SRC="${XPATH_ELEMENTS[4]}"
|
||||
SIZE="${XPATH_ELEMENTS[5]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[1]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[2]:-$VG_NAME}"
|
||||
SRC="${XPATH_ELEMENTS[3]}"
|
||||
SIZE="${XPATH_ELEMENTS[4]}"
|
||||
|
||||
SAFE_DIRS=""
|
||||
|
||||
@ -66,7 +64,7 @@ SRC_PATH=`echo $SRC|cut -d. -f2`
|
||||
LV_SRC=$(echo $SRC_PATH|cut -d. -f2)
|
||||
DEV_SRC="/dev/$VG_NAME/$LV_SRC"
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
LV_NAME="lv-one-${ID}"
|
||||
LVM_SOURCE="$DST_HOST:$VG_NAME.$LV_NAME"
|
||||
|
@ -51,7 +51,6 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/PATH \
|
||||
@ -64,17 +63,16 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[1]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[2]}"
|
||||
UMASK="${XPATH_ELEMENTS[3]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[4]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[5]:-$VG_NAME}"
|
||||
SRC="${XPATH_ELEMENTS[6]}"
|
||||
SIZE="${XPATH_ELEMENTS[7]}"
|
||||
MD5="${XPATH_ELEMENTS[8]}"
|
||||
SHA1="${XPATH_ELEMENTS[9]}"
|
||||
NO_DECOMPRESS="${XPATH_ELEMENTS[10]}"
|
||||
LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[11]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[3]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[4]:-$VG_NAME}"
|
||||
SRC="${XPATH_ELEMENTS[5]}"
|
||||
SIZE="${XPATH_ELEMENTS[6]}"
|
||||
MD5="${XPATH_ELEMENTS[7]}"
|
||||
SHA1="${XPATH_ELEMENTS[8]}"
|
||||
NO_DECOMPRESS="${XPATH_ELEMENTS[9]}"
|
||||
LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[10]}"
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
LV_NAME="lv-one-${ID}"
|
||||
LVM_SOURCE="$DST_HOST:$VG_NAME.$LV_NAME"
|
||||
|
@ -49,7 +49,6 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/FSTYPE \
|
||||
@ -58,13 +57,12 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[1]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[2]}"
|
||||
UMASK="${XPATH_ELEMENTS[3]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[4]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[5]:-$VG_NAME}"
|
||||
FSTYPE="${XPATH_ELEMENTS[6]}"
|
||||
SIZE="${XPATH_ELEMENTS[7]}"
|
||||
DST_HOST="${XPATH_ELEMENTS[3]:-$HOST}"
|
||||
VG_NAME="${XPATH_ELEMENTS[4]:-$VG_NAME}"
|
||||
FSTYPE="${XPATH_ELEMENTS[5]}"
|
||||
SIZE="${XPATH_ELEMENTS[6]}"
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
LV_NAME="lv-one-${ID}"
|
||||
LVM_SOURCE="$DST_HOST:$VG_NAME.$LV_NAME"
|
||||
|
@ -49,7 +49,6 @@ unset i XPATH_ELEMENTS
|
||||
while IFS= read -r -d '' element; do
|
||||
XPATH_ELEMENTS[i++]="$element"
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/DS_USE_SSH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/ID \
|
||||
@ -58,13 +57,12 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/TYPE)
|
||||
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
UMASK="${XPATH_ELEMENTS[1]}"
|
||||
BRIDGE_LIST="${XPATH_ELEMENTS[2]}"
|
||||
USE_SSH="${XPATH_ELEMENTS[3]:-$DS_USE_SSH}"
|
||||
DS_ID="${XPATH_ELEMENTS[4]}"
|
||||
SRC="${XPATH_ELEMENTS[5]}"
|
||||
IMAGE_ID="${XPATH_ELEMENTS[6]}"
|
||||
IMAGE_TYPE="${XPATH_ELEMENTS[7]}"
|
||||
BRIDGE_LIST="${XPATH_ELEMENTS[1]}"
|
||||
USE_SSH="${XPATH_ELEMENTS[2]:-$DS_USE_SSH}"
|
||||
DS_ID="${XPATH_ELEMENTS[3]}"
|
||||
SRC="${XPATH_ELEMENTS[4]}"
|
||||
IMAGE_ID="${XPATH_ELEMENTS[5]}"
|
||||
IMAGE_TYPE="${XPATH_ELEMENTS[6]}"
|
||||
|
||||
SRC_FOLDER=`basename $SRC`
|
||||
DST=`generate_image_path`
|
||||
@ -73,7 +71,7 @@ DST_HOST=`get_destination_host $IMAGE_ID`
|
||||
|
||||
# ------------ Set up datastore -------------
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
vmfs_set_up
|
||||
|
||||
|
@ -57,7 +57,6 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/DS_USE_SSH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/DS_TMP_DIR \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/PATH \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/TEMPLATE/MD5 \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/TEMPLATE/SHA1 \
|
||||
@ -73,14 +72,13 @@ SAFE_DIRS="${XPATH_ELEMENTS[3]}"
|
||||
BRIDGE_LIST="${XPATH_ELEMENTS[4]}"
|
||||
USE_SSH="${XPATH_ELEMENTS[5]:-$DS_USE_SSH}"
|
||||
TMP_DIR="${XPATH_ELEMENTS[6]:-$DS_TMP_DIR}"
|
||||
UMASK="${XPATH_ELEMENTS[7]}"
|
||||
SRC="${XPATH_ELEMENTS[8]}"
|
||||
MD5="${XPATH_ELEMENTS[9]}"
|
||||
SHA1="${XPATH_ELEMENTS[10]}"
|
||||
IMAGE_ID="${XPATH_ELEMENTS[11]}"
|
||||
IMAGE_TYPE="${XPATH_ELEMENTS[12]}"
|
||||
NO_DECOMPRESS="${XPATH_ELEMENTS[13]}"
|
||||
LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[14]}"
|
||||
SRC="${XPATH_ELEMENTS[7]}"
|
||||
MD5="${XPATH_ELEMENTS[8]}"
|
||||
SHA1="${XPATH_ELEMENTS[9]}"
|
||||
IMAGE_ID="${XPATH_ELEMENTS[10]}"
|
||||
IMAGE_TYPE="${XPATH_ELEMENTS[11]}"
|
||||
NO_DECOMPRESS="${XPATH_ELEMENTS[12]}"
|
||||
LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[13]}"
|
||||
|
||||
FE_DST=`generate_image_path`
|
||||
DST_FOLDER=`basename $FE_DST`
|
||||
@ -90,7 +88,7 @@ DST_HOST=`get_destination_host $IMAGE_ID`
|
||||
|
||||
# ------------ Set up datastore -------------
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
vmfs_set_up
|
||||
|
||||
|
@ -51,7 +51,6 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/DS_USE_SSH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/ID \
|
||||
@ -62,13 +61,12 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[1]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[2]}"
|
||||
UMASK="${XPATH_ELEMENTS[3]}"
|
||||
BRIDGE_LIST="${XPATH_ELEMENTS[4]}"
|
||||
USE_SSH="${XPATH_ELEMENTS[5]:-$DS_USE_SSH}"
|
||||
DS_ID="${XPATH_ELEMENTS[6]}"
|
||||
FSTYPE="${XPATH_ELEMENTS[7]}"
|
||||
SIZE="${XPATH_ELEMENTS[8]}"
|
||||
IMAGE_ID="${XPATH_ELEMENTS[9]}"
|
||||
BRIDGE_LIST="${XPATH_ELEMENTS[3]}"
|
||||
USE_SSH="${XPATH_ELEMENTS[4]:-$DS_USE_SSH}"
|
||||
DS_ID="${XPATH_ELEMENTS[5]}"
|
||||
FSTYPE="${XPATH_ELEMENTS[6]}"
|
||||
SIZE="${XPATH_ELEMENTS[7]}"
|
||||
IMAGE_ID="${XPATH_ELEMENTS[8]}"
|
||||
DST=`generate_image_path`
|
||||
DST_DIR=`dirname $DST`
|
||||
DST_FOLDER=`basename $DST`
|
||||
@ -76,7 +74,7 @@ DST_HOST=`get_destination_host $IMAGE_ID`
|
||||
|
||||
# ------------ Set up datastore -------------
|
||||
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
vmfs_set_up
|
||||
|
||||
|
@ -50,7 +50,6 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/PATH \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/TEMPLATE/MD5 \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/TEMPLATE/SHA1 \
|
||||
@ -60,15 +59,14 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[1]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[2]}"
|
||||
UMASK="${XPATH_ELEMENTS[3]}"
|
||||
SRC="${XPATH_ELEMENTS[4]}"
|
||||
MD5="${XPATH_ELEMENTS[5]}"
|
||||
SHA1="${XPATH_ELEMENTS[6]}"
|
||||
NO_DECOMPRESS="${XPATH_ELEMENTS[7]}"
|
||||
LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[8]}"
|
||||
SRC="${XPATH_ELEMENTS[3]}"
|
||||
MD5="${XPATH_ELEMENTS[4]}"
|
||||
SHA1="${XPATH_ELEMENTS[5]}"
|
||||
NO_DECOMPRESS="${XPATH_ELEMENTS[6]}"
|
||||
LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[7]}"
|
||||
|
||||
mkdir -p "$BASE_PATH"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
DST=`generate_image_path`
|
||||
|
||||
|
@ -48,19 +48,17 @@ while IFS= read -r -d '' element; do
|
||||
done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \
|
||||
/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/UMASK \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/FSTYPE \
|
||||
/DS_DRIVER_ACTION_DATA/IMAGE/SIZE)
|
||||
|
||||
BASE_PATH="${XPATH_ELEMENTS[0]}"
|
||||
RESTRICTED_DIRS="${XPATH_ELEMENTS[1]}"
|
||||
SAFE_DIRS="${XPATH_ELEMENTS[2]}"
|
||||
UMASK="${XPATH_ELEMENTS[3]}"
|
||||
FSTYPE="${XPATH_ELEMENTS[4]}"
|
||||
SIZE="${XPATH_ELEMENTS[5]}"
|
||||
FSTYPE="${XPATH_ELEMENTS[3]}"
|
||||
SIZE="${XPATH_ELEMENTS[4]}"
|
||||
|
||||
mkdir -p "$BASE_PATH"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
|
||||
set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS"
|
||||
|
||||
DST=`generate_image_path`
|
||||
|
||||
|
@ -56,7 +56,6 @@ DST_PATH="${SRC_DS_PATH}${DST_ARG_PATH##$DST_DS_PATH}"
|
||||
# Move the image back to the datastore
|
||||
#-------------------------------------------------------------------------------
|
||||
CPSCRIPT=$(cat <<EOF
|
||||
umask 0007
|
||||
SRC_READLN=\$($READLINK -f $SRC_PATH)
|
||||
DST_READLN=\$($READLINK -f $DST_PATH)
|
||||
|
||||
|
@ -56,7 +56,6 @@ DST_PATH="${SRC_DS_PATH}${DST_ARG_PATH##$DST_DS_PATH}"
|
||||
# Move the image back to the datastore
|
||||
#-------------------------------------------------------------------------------
|
||||
MVSCRIPT=$(cat <<EOF
|
||||
umask 0007
|
||||
SRC_READLN=\$($READLINK -f $SRC_PATH)
|
||||
DST_READLN=\$($READLINK -f $DST_PATH)
|
||||
|
||||
|
@ -56,7 +56,6 @@ DST_PATH="${SRC_DS_PATH}${DST_ARG_PATH##$DST_DS_PATH}"
|
||||
# Move the image back to the datastore
|
||||
#-------------------------------------------------------------------------------
|
||||
CPSCRIPT=$(cat <<EOF
|
||||
umask 0007
|
||||
SRC_READLN=\$($READLINK -f $SRC_PATH)
|
||||
DST_READLN=\$($READLINK -f $DST_PATH)
|
||||
|
||||
|
@ -56,7 +56,6 @@ DST_PATH="${SRC_DS_PATH}${DST_ARG_PATH##$DST_DS_PATH}"
|
||||
# Move the image back to the datastore
|
||||
#-------------------------------------------------------------------------------
|
||||
MVSCRIPT=$(cat <<EOF
|
||||
umask 0007
|
||||
SRC_READLN=\$($READLINK -f $SRC_PATH)
|
||||
DST_READLN=\$($READLINK -f $DST_PATH)
|
||||
|
||||
|
@ -33,9 +33,6 @@ ONE_SH=$ONE_LIB/sh
|
||||
|
||||
. $ONE_SH/scripts_common.sh
|
||||
|
||||
# Set umask
|
||||
umask 0007
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Function to get hosts and paths from arguments
|
||||
# ------------------------------------------------------------------------------
|
||||
@ -110,7 +107,7 @@ function disk_type
|
||||
XPATH="${ONE_LOCAL_VAR}/remotes/datastore/xpath.rb --stdin"
|
||||
|
||||
unset i XPATH_ELEMENTS
|
||||
|
||||
|
||||
while IFS= read -r -d '' element; do
|
||||
XPATH_ELEMENTS[i++]="$element"
|
||||
done < <(onevm show -x $VMID| $XPATH \
|
||||
|
Loading…
Reference in New Issue
Block a user