From 265030ec9f488347d3c2e4fcd115dc1c74655e8a Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Sat, 12 Sep 2015 16:55:19 +0200 Subject: [runvirt] detect_legacy.inc: Some more cosmetics. --- .../data/opt/openslx/scripts/includes/detect_legacy.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'remote') 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 -- cgit v1.2.3-55-g7522