From eddb3dbfbd737234ee6310ea44005bbd2e7ffbbe Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 19 Sep 2013 16:04:26 +0200 Subject: [PATCH] Change HOST to BRIDGE_LIST for all the DS drivers in ceph, iscsi and lvm drivers --- src/datastore_mad/remotes/ceph/clone | 8 +++++--- src/datastore_mad/remotes/ceph/mkfs | 8 +++++--- src/datastore_mad/remotes/ceph/monitor | 8 +++++--- src/datastore_mad/remotes/ceph/rm | 8 +++++--- src/datastore_mad/remotes/iscsi/clone | 8 +++++--- src/datastore_mad/remotes/iscsi/mkfs | 8 +++++--- src/datastore_mad/remotes/iscsi/monitor | 8 +++++--- src/datastore_mad/remotes/iscsi/rm | 8 +++++--- src/datastore_mad/remotes/lvm/clone | 8 +++++--- src/datastore_mad/remotes/lvm/mkfs | 8 +++++--- src/datastore_mad/remotes/lvm/monitor | 8 +++++--- src/datastore_mad/remotes/lvm/rm | 8 +++++--- 12 files changed, 60 insertions(+), 36 deletions(-) diff --git a/src/datastore_mad/remotes/ceph/clone b/src/datastore_mad/remotes/ceph/clone index 112f32cd24..5d91b387ac 100755 --- a/src/datastore_mad/remotes/ceph/clone +++ b/src/datastore_mad/remotes/ceph/clone @@ -45,7 +45,7 @@ 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/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/POOL_NAME \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ /DS_DRIVER_ACTION_DATA/IMAGE/SIZE) @@ -53,13 +53,15 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ unset i BASE_PATH="${XPATH_ELEMENTS[i++]}" -DST_HOST="${XPATH_ELEMENTS[i++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[i++]}" POOL_NAME="${XPATH_ELEMENTS[i++]:-$POOL_NAME}" SRC="${XPATH_ELEMENTS[i++]}" SIZE="${XPATH_ELEMENTS[i++]}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/ceph/mkfs b/src/datastore_mad/remotes/ceph/mkfs index 35762cd347..7dd3018a8c 100755 --- a/src/datastore_mad/remotes/ceph/mkfs +++ b/src/datastore_mad/remotes/ceph/mkfs @@ -49,7 +49,7 @@ 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/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/POOL_NAME \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/STAGING_DIR \ /DS_DRIVER_ACTION_DATA/IMAGE/FSTYPE \ @@ -60,14 +60,16 @@ unset i BASE_PATH="${XPATH_ELEMENTS[i++]}" RESTRICTED_DIRS="${XPATH_ELEMENTS[i++]}" SAFE_DIRS="${XPATH_ELEMENTS[i++]}" -DST_HOST="${XPATH_ELEMENTS[i++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[i++]}" POOL_NAME="${XPATH_ELEMENTS[i++]:-$POOL_NAME}" STAGING_DIR="${XPATH_ELEMENTS[i++]:-$STAGING_DIR}" FSTYPE="${XPATH_ELEMENTS[i++]}" SIZE="${XPATH_ELEMENTS[i++]}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/ceph/monitor b/src/datastore_mad/remotes/ceph/monitor index fb988d1f60..b4d22f6559 100755 --- a/src/datastore_mad/remotes/ceph/monitor +++ b/src/datastore_mad/remotes/ceph/monitor @@ -45,14 +45,16 @@ unset i j XPATH_ELEMENTS while IFS= read -r -d '' element; do XPATH_ELEMENTS[i++]="$element" -done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \ +done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/POOL_NAME) -HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" POOL_NAME="${XPATH_ELEMENTS[j++]:-$POOL_NAME}" +HOST=`get_destination_host $IMAGE_ID` + if [ -z "$HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/ceph/rm b/src/datastore_mad/remotes/ceph/rm index f52c06868b..51e519c2f4 100755 --- a/src/datastore_mad/remotes/ceph/rm +++ b/src/datastore_mad/remotes/ceph/rm @@ -45,15 +45,17 @@ unset i XPATH_ELEMENTS while IFS= read -r -d '' element; do XPATH_ELEMENTS[i++]="$element" done < <($XPATH /DS_DRIVER_ACTION_DATA/IMAGE/SOURCE \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST) + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST) unset i SRC="${XPATH_ELEMENTS[i++]}" -DST_HOST="${XPATH_ELEMENTS[i++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[i++]}" + +DST_HOST=`get_destination_host $IMAGE_ID` if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/iscsi/clone b/src/datastore_mad/remotes/iscsi/clone index d1fc5b8a88..96fe43b2ff 100755 --- a/src/datastore_mad/remotes/iscsi/clone +++ b/src/datastore_mad/remotes/iscsi/clone @@ -47,7 +47,7 @@ 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/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_IQN \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ @@ -56,14 +56,16 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ BASE_PATH="${XPATH_ELEMENTS[j++]}" RESTRICTED_DIRS="${XPATH_ELEMENTS[j++]}" SAFE_DIRS="${XPATH_ELEMENTS[j++]}" -DST_HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" VG_NAME="${XPATH_ELEMENTS[j++]:-$VG_NAME}" BASE_IQN="${XPATH_ELEMENTS[j++]:-$BASE_IQN}" SRC="${XPATH_ELEMENTS[j++]}" SIZE="${XPATH_ELEMENTS[j++]}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/iscsi/mkfs b/src/datastore_mad/remotes/iscsi/mkfs index 3672a7df6a..f205c592a6 100755 --- a/src/datastore_mad/remotes/iscsi/mkfs +++ b/src/datastore_mad/remotes/iscsi/mkfs @@ -49,7 +49,7 @@ 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/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_IQN \ /DS_DRIVER_ACTION_DATA/IMAGE/FSTYPE \ @@ -58,14 +58,16 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ BASE_PATH="${XPATH_ELEMENTS[j++]}" RESTRICTED_DIRS="${XPATH_ELEMENTS[j++]}" SAFE_DIRS="${XPATH_ELEMENTS[j++]}" -DST_HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" VG_NAME="${XPATH_ELEMENTS[j++]:-$VG_NAME}" BASE_IQN="${XPATH_ELEMENTS[j++]:-$BASE_IQN}" FSTYPE="${XPATH_ELEMENTS[j++]}" SIZE="${XPATH_ELEMENTS[j++]:-0}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/iscsi/monitor b/src/datastore_mad/remotes/iscsi/monitor index 11b4d882b6..727e433948 100755 --- a/src/datastore_mad/remotes/iscsi/monitor +++ b/src/datastore_mad/remotes/iscsi/monitor @@ -45,14 +45,16 @@ unset i j XPATH_ELEMENTS while IFS= read -r -d '' element; do XPATH_ELEMENTS[i++]="$element" -done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \ +done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME) -HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" VG_NAME="${XPATH_ELEMENTS[j++]:-$VG_NAME}" +HOST=`get_destination_host $IMAGE_ID` + if [ -z "$HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/iscsi/rm b/src/datastore_mad/remotes/iscsi/rm index a200b6bfc0..8ac1bb4ff0 100755 --- a/src/datastore_mad/remotes/iscsi/rm +++ b/src/datastore_mad/remotes/iscsi/rm @@ -45,13 +45,15 @@ unset i j XPATH_ELEMENTS while IFS= read -r -d '' element; do XPATH_ELEMENTS[i++]="$element" done < <($XPATH /DS_DRIVER_ACTION_DATA/IMAGE/SOURCE \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST) + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST) SRC="${XPATH_ELEMENTS[j++]}" -DST_HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" + +DST_HOST=`get_destination_host $IMAGE_ID` if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/lvm/clone b/src/datastore_mad/remotes/lvm/clone index 7c99033e47..388370700d 100755 --- a/src/datastore_mad/remotes/lvm/clone +++ b/src/datastore_mad/remotes/lvm/clone @@ -45,19 +45,21 @@ unset i j 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/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ /DS_DRIVER_ACTION_DATA/IMAGE/SIZE) BASE_PATH="${XPATH_ELEMENTS[j++]}" -DST_HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" VG_NAME="${XPATH_ELEMENTS[j++]:-$VG_NAME}" SRC="${XPATH_ELEMENTS[j++]}" SIZE="${XPATH_ELEMENTS[j++]}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/lvm/mkfs b/src/datastore_mad/remotes/lvm/mkfs index 3f28dcef97..42a4a43a05 100755 --- a/src/datastore_mad/remotes/lvm/mkfs +++ b/src/datastore_mad/remotes/lvm/mkfs @@ -49,7 +49,7 @@ 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/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ /DS_DRIVER_ACTION_DATA/IMAGE/FSTYPE \ /DS_DRIVER_ACTION_DATA/IMAGE/SIZE) @@ -57,13 +57,15 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ BASE_PATH="${XPATH_ELEMENTS[j++]}" RESTRICTED_DIRS="${XPATH_ELEMENTS[j++]}" SAFE_DIRS="${XPATH_ELEMENTS[j++]}" -DST_HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" VG_NAME="${XPATH_ELEMENTS[j++]:-$VG_NAME}" FSTYPE="${XPATH_ELEMENTS[j++]}" SIZE="${XPATH_ELEMENTS[j++]}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/lvm/monitor b/src/datastore_mad/remotes/lvm/monitor index f67557ae3b..03f21a87d4 100755 --- a/src/datastore_mad/remotes/lvm/monitor +++ b/src/datastore_mad/remotes/lvm/monitor @@ -45,14 +45,16 @@ unset i j XPATH_ELEMENTS while IFS= read -r -d '' element; do XPATH_ELEMENTS[i++]="$element" -done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \ +done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME) -HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" VG_NAME="${XPATH_ELEMENTS[j++]:-$VG_NAME}" +HOST=`get_destination_host $IMAGE_ID` + if [ -z "$HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi # ------------ Compute datastore usage ------------- diff --git a/src/datastore_mad/remotes/lvm/rm b/src/datastore_mad/remotes/lvm/rm index 7543df6e5d..c59df21dda 100755 --- a/src/datastore_mad/remotes/lvm/rm +++ b/src/datastore_mad/remotes/lvm/rm @@ -45,13 +45,15 @@ unset i j XPATH_ELEMENTS while IFS= read -r -d '' element; do XPATH_ELEMENTS[i++]="$element" done < <($XPATH /DS_DRIVER_ACTION_DATA/IMAGE/SOURCE \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST) + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST) SRC="${XPATH_ELEMENTS[j++]}" -DST_HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" + +DST_HOST=`get_destination_host $IMAGE_ID` if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi