summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorSimon Rettberg2013-10-15 16:01:51 +0200
committerSimon Rettberg2013-10-15 16:01:51 +0200
commit9ca0ce06f0d7d9241edb219a0736c04091df8c04 (patch)
tree7882f29f0c74d841de5ffd137c2834f8021aa450 /remote
parent[vmchooser/xmlfilter] filter out virtualbox images since vbox is not supporte... (diff)
downloadtm-scripts-9ca0ce06f0d7d9241edb219a0736c04091df8c04.tar.gz
tm-scripts-9ca0ce06f0d7d9241edb219a0736c04091df8c04.tar.xz
tm-scripts-9ca0ce06f0d7d9241edb219a0736c04091df8c04.zip
[vmchooser] Fix indentation of xml-filter
Diffstat (limited to 'remote')
-rwxr-xr-xremote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-xml_filter76
1 files changed, 38 insertions, 38 deletions
diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-xml_filter b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-xml_filter
index fad8c064..4faea740 100755
--- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-xml_filter
+++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-xml_filter
@@ -30,44 +30,44 @@
. /opt/openslx/config
if [ -f ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/vmchooser.conf ]; then
- . ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/vmchooser.conf
+ . ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/vmchooser.conf
fi
function handlePersistentVM() {
- if [[ "$(grep --extended-regexp \
- "<persistent param=\"(|.+:)$USER(|:.+)\"" "$1")" ]]; then
- # If this virtual machine is useable as persistent version for current
- # user we provide an additional persistent version.
- local imageName=$(basename "$(grep -io '<image_name param=.*"' "$1" | \
- sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')") && \
- eval export SLX_VM_PERSISTENT_PATH="${SLX_VM_PERSISTENT_PATH}" && \
- local imagePath="${SLX_VM_PERSISTENT_PATH}${imageName}"
- local persistentConfigVersionFilePath="$(mktemp --directory)/$(basename \
- "$1")" && \
- local vmchooserFilePath="$(dirname "$0")/vmchooser-clc" && \
- if [ ! -f "$vmchooserFilePath" ]; then
- vmchooserFilePath='/opt/openslx/plugin-repo/vmchooser/vmchooser-clc'
- fi
- bash "$vmchooserFilePath" "$1" "$persistentConfigVersionFilePath" \
- --create-persistent-config "$imagePath" && \
- echo "$persistentConfigVersionFilePath"
- fi
-}
-
-for FILE in $(find -L "$1" -iname "*.xml"); do
- # filter all xmls which aren't set active
- grep -i -q "<active param=.*true.*" "$FILE" || continue
- # HACK: filter all virtualbox images, as vbox is not ready yet
- grep -i -q "<virtualmachine param=.*virtualbox.*" "$FILE" && continue
- if [ -n "${vmchooser_env}" ]; then
- # filter all xmls with pool-param not equal to vmchooser::env
- if [ $(grep "<pools param=\"${vmchooser_env}\"" "$FILE" | wc -l) -eq 1 ]; then
- handlePersistentVM "$FILE"
- echo "$FILE"
- fi
- else
- handlePersistentVM "$FILE"
- # if there is no pool set, just take all available xmls
- echo "$FILE"
- fi
-done
+ if [[ "$(grep --extended-regexp \
+ "<persistent param=\"(|.+:)$USER(|:.+)\"" "$1")" ]]; then
+ # If this virtual machine is useable as persistent version for current
+ # user we provide an additional persistent version.
+ local imageName=$(basename "$(grep -io '<image_name param=.*"' "$1" | \
+ sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')") && \
+ eval export SLX_VM_PERSISTENT_PATH="${SLX_VM_PERSISTENT_PATH}" && \
+ local imagePath="${SLX_VM_PERSISTENT_PATH}${imageName}"
+ local persistentConfigVersionFilePath="$(mktemp --directory)/$(basename \
+ "$1")" && \
+ local vmchooserFilePath="$(dirname "$0")/vmchooser-clc" && \
+ if [ ! -f "$vmchooserFilePath" ]; then
+ vmchooserFilePath='/opt/openslx/plugin-repo/vmchooser/vmchooser-clc'
+ fi
+ bash "$vmchooserFilePath" "$1" "$persistentConfigVersionFilePath" \
+ --create-persistent-config "$imagePath" && \
+ echo "$persistentConfigVersionFilePath"
+ fi
+ }
+
+ for FILE in $(find -L "$1" -iname "*.xml"); do
+ # filter all xmls which aren't set active
+ grep -i -q "<active param=.*true.*" "$FILE" || continue
+ # HACK: filter all virtualbox images, as vbox is not ready yet
+ grep -i -q "<virtualmachine param=.*virtualbox.*" "$FILE" && continue
+ if [ -n "${vmchooser_env}" ]; then
+ # filter all xmls with pool-param not equal to vmchooser::env
+ if [ $(grep "<pools param=\"${vmchooser_env}\"" "$FILE" | wc -l) -eq 1 ]; then
+ handlePersistentVM "$FILE"
+ echo "$FILE"
+ fi
+ else
+ handlePersistentVM "$FILE"
+ # if there is no pool set, just take all available xmls
+ echo "$FILE"
+ fi
+ done