diff options
| -rw-r--r-- | remote/modules/run-virt/data/opt/openslx/scripts/includes/detect_legacy.inc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/detect_legacy.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/detect_legacy.inc index 13670bb1..7211c5be 100644 --- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/detect_legacy.inc +++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/detect_legacy.inc @@ -5,7 +5,7 @@ # Legacy mode: As runvirt has been before. # New mode: uuid in xml _and_ vmx given via http. -writelog "Now in detect_legacy.inc" +writelog "Detecting current/legacy mode ..." TMPDIR=$(mktemp -d -p /tmp/virt) ERR=$? @@ -23,18 +23,18 @@ if [ ! -n "$IMGUUID" ]; then # Keine uuid: Abbruch, Legacy writelog "Could not extract an uuid param from ${xmlfile}. Triggering legacy mode." LEGACY=: # No uuid; legacy. else - writelog "else-Zweig" # Now getting template file: if wget -O "$TMPDIR/$IMGUUID" "${SLX_VMCHOOSER_BASE_URL}/lecture/${IMGUUID}" 1>&2 2>/dev/null; then writelog "wget ${SLX_VMCHOOSER_BASE_URL}/lecture/${IMGUUID} successful." + writelog "Triggering current (non-legacy) mode." LEGACY= # both strings set: no legacy. + if [ ! -s "$TMPDIR/$IMGUUID" ]; then + LEGACY= # no legacy: server sent 0 byte file. + writelog "Server sent zero byte vmx template uuid file. Retriggering legacy mode." + fi else writelog "wget ${SLX_VMCHOOSER_BASE_URL}/lecture/${IMGUUID}: Error code $ERR. Triggering legacy mode." LEGACY=: fi fi -if [ ! -s "$TMPDIR/$IMGUUID" ]; then - LEGACY= # no legacy: server sent 0 byte file. - writelog "Server sent zero byte vmx template uuid file. Triggering legacy mode." -fi |
