diff options
Diffstat (limited to 'core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/parse_vmx.inc')
-rw-r--r-- | core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/parse_vmx.inc | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/parse_vmx.inc b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/parse_vmx.inc deleted file mode 100644 index 47330bb0..00000000 --- a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/parse_vmx.inc +++ /dev/null @@ -1,32 +0,0 @@ -###################################################################### -# Include: Parsing the non-legacy delivered vmxfile ${TMPCONFIG} # -###################################################################### -## Functions -parse_vmx() { - # To avoid potential syntax problems from the vmx served by dmsd, sanitize - # it before continuing with filling in the gaps - local TMPTMPCONFIG="$(mktemp)" - grep -E '^\s*(#|[^=]+=[^"]*"[^"]*"\s*$|[^=]+=[^"]+$|$)' "$TMPCONFIG" > "$TMPTMPCONFIG" - if ! diff -q "$TMPCONFIG" "$TMPTMPCONFIG"; then - # file was corrupted, log it - writelog "'$TMPCONFIG' had bad syntax and was pruned by the post-download sanitizer!" - slxlog -s "virt-vmware-vmx-corrupt" "Downloaded .vmx for '$IMGUUID' has a corrupted format!" "$TMPCONFIG" - fi - mv -f -- "$TMPTMPCONFIG" "$TMPCONFIG" - - writelog "Parsing virtual machine description file..." - local -i HW_VERSION=$(grep -i -m1 '^virtualHW.version *= *' "${TMPCONFIG}" | awk -F '=' '{print $2}' | sed -r 's/[^0-9]//g') - if notempty HW_VERSION; then - declare -g VM_HW_VERSION="${HW_VERSION}" - return 0 - fi - return 1 -} - -## MAIN ## -if notempty TMPCONFIG; then - call_post_source parse_vmx -else - writelog "Path to VMX file is not set or empty! Aborting..." - EXIT_TYPE="internal" EXIT_REASON="Konnte Pfad zur VMX-Datei nicht finden!" cleanexit 1 -fi |