summaryrefslogtreecommitdiffstats
path: root/core/modules/vmware-common
diff options
context:
space:
mode:
authorSimon Rettberg2020-10-16 14:51:05 +0200
committerSimon Rettberg2020-10-16 14:51:05 +0200
commit3e0c4b8f42edacf3a89ee2da76b54e8443ef4d5f (patch)
treeeef9c980fa3977f57e776f104417fccd0b621c77 /core/modules/vmware-common
parent[vmware-common] Fix indentation (diff)
downloadmltk-3e0c4b8f42edacf3a89ee2da76b54e8443ef4d5f.tar.gz
mltk-3e0c4b8f42edacf3a89ee2da76b54e8443ef4d5f.tar.xz
mltk-3e0c4b8f42edacf3a89ee2da76b54e8443ef4d5f.zip
[vmware-common] Get rid of XML lookup for maxHWversion
This was a hack anyways, now that we have to maintain a list ourselves this seems pointless.
Diffstat (limited to 'core/modules/vmware-common')
-rw-r--r--core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc25
1 files changed, 10 insertions, 15 deletions
diff --git a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc
index ae1900cd..01abdfd0 100644
--- a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc
+++ b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc
@@ -36,21 +36,16 @@ declare -rg VM_HOME="${HOME}/.vmware"
$(safesource "${VMWARE_PLUGIN_DIR}/vmware.conf")
# Determine maximum hw version
-# Try to tell from the xml files in this dir, and hope nobody added any
-gmax="$( find /etc/vmware/hostd/env/ -name "ws-*.xml" | grep -o '[0-9]*' | sort -nr | head -n 1 )"
-if [ -z "$gmax" ]; then
- # Failed, VMware 16 doesn't have above xml files anymore, great. Back to hard coded lists
- gmax="$( grep -m 1 -F '.product.version' /etc/vmware/config | grep -oE '[0-9]+\.[0-9.]+' | head -n 1 )"
- case "$gmax" in
- 16.*) gmax=18 ;;
- 15.5.*|15.1.*) gmax=16 ;;
- *)
- # No hit, guess major version number == max hw version, which unfortunately VMware decided to fuck up with
- # VMware 15.1.0, which supports hw version 16
- gmax="${gmax%%.*}"
- ;;
- esac
-fi
+gmax="$( grep -m 1 -F '.product.version' /etc/vmware/config | grep -oE '[0-9]+\.[0-9.]+' | head -n 1 )"
+case "$gmax" in
+ 16.*) gmax=18 ;;
+ 15.5.*|15.1.*) gmax=16 ;;
+ *)
+ # No hit, guess major version number == max hw version, which unfortunately VMware decided to fuck up with
+ # VMware 15.1.0, which supports hw version 16
+ gmax="${gmax%%.*}"
+ ;;
+esac
[ -n "$gmax" ] && maxhardwareversion="$gmax"