diff options
author | Simon Rettberg | 2016-10-19 15:07:25 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-10-19 15:07:25 +0200 |
commit | 7c70ebde186c9589bd6e56f04d9f9bab682a3c14 (patch) | |
tree | a50105db62d13275dfacb774a15c51cdea76bcfc /remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_vm_hypervisor.inc | |
parent | [vmware/run-virt] Try to rename includes to what they actually do (diff) | |
download | tm-scripts-7c70ebde186c9589bd6e56f04d9f9bab682a3c14.tar.gz tm-scripts-7c70ebde186c9589bd6e56f04d9f9bab682a3c14.tar.xz tm-scripts-7c70ebde186c9589bd6e56f04d9f9bab682a3c14.zip |
[run-virt] More cleanup; kill legacy support, rename and move includes, kill dead code
Diffstat (limited to 'remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_vm_hypervisor.inc')
-rw-r--r-- | remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_vm_hypervisor.inc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_vm_hypervisor.inc b/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_vm_hypervisor.inc new file mode 100644 index 00000000..ce15524f --- /dev/null +++ b/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_vm_hypervisor.inc @@ -0,0 +1,34 @@ +########################################################################## +# Include: Setup virtual machine hypervisor via vm-specific include file # +########################################################################## + +# Get all virtual machine specific stuff from the respective include file +if [ ! -e "$VMCHOOSER_DIR/$xmlvirt/run-virt.include" ] ; then + slxlog "virt-plugin-missing" "Could not find run-virt.include for $xmlvirt ($VMCHOOSER_DIR/$xmlvirt/run-virt.include)" + writelog "Failed because of missing ${xmlvirt} plugin." + error_user "Konnte den Virtualisierer '$xmlvirt' nicht finden. Starten der Virtuellen Maschine fehlgeschlagen. + Starten Sie den Computer neu und wenden Sie sich an den Support, wenn das Problem weiterhin besteht." + cleanexit 1 +fi + +self="${xmlvirt}" + +if ! bash -n "$VMCHOOSER_DIR/$xmlvirt/run-virt.include"; then + slxlog "virt-plugin-syntax" "run-virt.include for $xmlvirt contains syntax errors (bash -n run-virt.include failed)" + writelog "Erroneous run-virt.include for $xmlvirt (syntax check)" + error_user "Das Start-Script für den Virtualisierer '$xmlvirt' ist fehlerhaft. + Starten Sie den Computer neu und wenden Sie sich an den Support, wenn das Problem weiterhin besteht." + cleanexit 1 +fi + +setup_vm_commandline () { + # Now including the hypervisor specific include file: + if ! source "$VMCHOOSER_DIR/$xmlvirt/run-virt.include"; then + slxlog "virt-plugin-error" "run-virt.include for $xmlvirt could not be sourced properly." + writelog "Erroneous run-virt.include for ${xmlvirt}? Source returned != 0" + error_user "Das Start-Script für den Virtualisierer '$xmlvirt' hat einen fehlercode zurückgegeben. + Starten Sie den Computer neu, falls es beim Ausführen der VM zu Problemen kommt + und wenden Sie sich an den Support, wenn das Problem weiterhin besteht." + fi +} + |