diff options
Diffstat (limited to 'remote/modules/run-virt/data/opt/openslx/scripts/includes/get_xml_file_dir_legacy.inc')
-rw-r--r-- | remote/modules/run-virt/data/opt/openslx/scripts/includes/get_xml_file_dir_legacy.inc | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/get_xml_file_dir_legacy.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/get_xml_file_dir_legacy.inc deleted file mode 100644 index c3c6f7b3..00000000 --- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/get_xml_file_dir_legacy.inc +++ /dev/null @@ -1,50 +0,0 @@ -######################################################### -# Include: Get xml file and directory (legacy, old way) # -######################################################### - -## Added for persistent support. -diskmode='nonpersistent' -if [[ "$(grep --extended-regexp \ - '< *short_description *param=".+ --persistent--"' "$1")" ]]; then - diskmode='persistent' - imageFilePath="$(grep -io '<image_path param=.*"' "$1" | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')" - [ -z "$imageFilePath" ] && imageFilePath="$(grep -io '<image_name param=.*"' "$1" | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')" - originalXMLFilePath="$(grep -io '<original_xml_file_path param=.*"' "$1" \ - | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')" - originalImageFileName="$(grep -io '<image_name param=.*"' \ - "$originalXMLFilePath" | sed -e "s/&.*;/; /g" | awk -F '"' \ - '{ print $2 }')" - originalVMDKFilePath="$(dirname \ - "$originalXMLFilePath")/${originalImageFileName}" - # Added to workaround path prefix coming from temporary generated xml file - # by vmchooser. - if [[ "$(grep --extended-regexp '^/tmp/tmp\.[^\/]+/' <<< \ - "$imageFilePath")" ]]; then - imageFilePath=$(sed -r 's/^\/?tmp\/[^\/]+\///g' \ - <<< "$imageFilePath") - sed -ir \ - "s/(<image_name param=\")[^\"]*(\")/\\1$(sed -e \ - 's/\\/\\\\/g' -e 's/\//\\\//g' -e \ - 's/&/\\\&/g' <<< "$imageFilePath")\\2/g" "$1" - fi - # Create linked clone if not exists. - if [ ! -f "$imageFilePath" ]; then - mkdir -p "$(dirname "$imageFilePath")" && \ - bash "$(dirname "$0")/vmchooser-clc" "$originalXMLFilePath" \ - "$imageFilePath" --debug --verbose &>"${LOGFILE}" - fi -fi - -# absolute or relative path? -xmlfile=$1 -if ls "${xmlfile}" 2>/dev/null | grep '/' >/dev/null 2>&1; then - xmlpath=$(dirname "${xmlfile}") - xmlfile=$(basename "${xmlfile}") -else - xmlpath=${vmchooser_xmlpath} -fi -# full path -xmlfile="${xmlpath}/${xmlfile%.xml}.xml" - -DO_PROFILE="$(grep -c -E -i '<\s*profile\s*param="?(true|yes)"?' "$xmlfile")" - |