summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes
diff options
context:
space:
mode:
authorSimon Rettberg2017-03-17 20:26:22 +0100
committerSimon Rettberg2017-03-17 20:26:22 +0100
commita49d09b434757f3444bf1d3e63c0376fae0b3416 (patch)
treeaf898b46792ed9fcebc849daa4faa5cb1b6e8df7 /core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes
parent[run-virt] fix typo (diff)
downloadmltk-a49d09b434757f3444bf1d3e63c0376fae0b3416.tar.gz
mltk-a49d09b434757f3444bf1d3e63c0376fae0b3416.tar.xz
mltk-a49d09b434757f3444bf1d3e63c0376fae0b3416.zip
[run-virt] Fix whitespace errors
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes')
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/get_xml_file_variables.inc12
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc15
2 files changed, 13 insertions, 14 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/get_xml_file_variables.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/get_xml_file_variables.inc
index a6543c76..59e4d232 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/get_xml_file_variables.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/get_xml_file_variables.inc
@@ -28,7 +28,7 @@ parse_xml() {
if isempty SRC_IMG_ABSOLUTE && [ "${SRC_IMG_ABSOLUTE:0:1}" != "/" ]; then
writelog "Error parsing XML: Parsed value for absolute path doesn't start with '/': '$SRC_IMG_ABSOLUTE'"
- EXIT_TYPE="user" EXIT_REASON="Ungültiger asboluter Pfad zur virtuellen Maschine!" cleanexit 1
+ EXIT_TYPE="user" EXIT_REASON="Ungültiger asboluter Pfad zur virtuellen Maschine!" cleanexit 1
fi
notempty SRC_IMG_ABSOLUTE || SRC_IMG_ABSOLUTE="${VMSTORE_PATH}/${SRC_IMG_RELATIVE}"
@@ -39,18 +39,18 @@ parse_xml() {
VM_DISPLAYNAME=$(get_xml "short_description")
notempty VM_DISPLAYNAME || VM_DISPLAYNAME="${IMG_BASENAME}"
readonly VM_DISPLAYNAME
-
+
# Define VM_CLEANNAME since VM_DISPLAYNAME can be long and contain weird characters
declare -rg VM_CLEANNAME=$(echo "${VM_DISPLAYNAME:0:32}" | sed -r 's/[^0-9a-zA-Z_-\.]+/_/g')
-
+
# image is for the following virtual machine
declare -rg PLUGIN_ID=$(get_xml "virtualmachine")
if isempty PLUGIN_ID; then
- writelog "Error parsing XML: No value for 'virtualmachine'."
+ writelog "Error parsing XML: No value for 'virtualmachine'."
EXIT_TYPE="user" EXIT_REASON="Konnte kein Virtualisierer für das ausgewählte Image ermitteln." cleanexit 1
fi
-
- # Extracting OS type (VM_OS_TYPE) from xml file. We don't care here whether VM_OS_TYPE is empty, as then
+
+ # Extracting OS type (VM_OS_TYPE) from xml file. We don't care here whether VM_OS_TYPE is empty, as then
# it will yield the default entries later on.
declare -g VM_OS_TYPE=$(get_xml "os")
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc
index 94b2c2db..2b7e5774 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc
@@ -108,7 +108,7 @@ add_cleanup() {
#
# EXIT_TYPE should be either:
# - 'internal' for critical internal errors, this will
-# automatically send the logfile via slxlog.
+# automatically send the logfile via slxlog.
# - 'user' for errors related to the user's choice
# Others could be thought of like 'external' for failures
# with remote services (e.g. slx apis, external image repo, ...)
@@ -159,7 +159,7 @@ cleanexit() {
writelog "Unknown EXIT_TYPE: '${EXIT_TYPE}'."
;;
esac
- fi
+ fi
if notempty EXIT_REASON; then
ERR_TEXT="${EXIT_REASON}"
else
@@ -185,7 +185,7 @@ ${ERR_FOOTER}
}
################# SOURCING FUNCTIONS #################
-# Wrapped 'source' that first checks for existence and
+# Wrapped 'source' that first checks for existence and
# syntax before actually sourcing the given file.
# The option '--exit' triggers cleanexit upon syntax errors.
# Without it, it returns 0 when tests passed, 1 otherwise.
@@ -198,7 +198,7 @@ safesource() {
# sanitze filename just to be sure as it is part of the eval coming later
# alphanumeric and - _ . should be enough for common file naming scheme
if [[ ! "$1" =~ ^[a-zA-Z0-9./_-]+$ ]]; then
- writelog "'$1' is a weird filename to source! Ignoring."
+ writelog "'$1' is a weird filename to source! Ignoring."
return 1
fi
local FILE="$1"
@@ -214,7 +214,7 @@ safesource() {
*) writelog --quiet "Syntax check (bash -n) returned unknown error code '${RET}' for: ${FILE}" ;;
esac
if [ $EXIT_ON_FAILURE -eq 1 ]; then
- echo "eval EXIT_REASON=\"internal:source:${FILE}\" cleanexit 1 ;"
+ echo "eval EXIT_REASON=\"internal:source:${FILE}\" cleanexit 1 ;"
else
echo "eval writelog \"Could not safesource '${FILE}'.\" ;"
fi
@@ -224,7 +224,7 @@ safesource() {
echo "run_post_source ${FILE} ;"
done
- return 0
+ return 0
}
# Registers functions to be called after sourcing an include.
@@ -345,7 +345,6 @@ is_function() {
# Helper to test if given arguments are declared as arrays
is_array() {
-
# -ne 1 ] && writelog "is_array: Expects 1 argument! $# given." && return 1
while [ $# -gt 0 ]; do
local ARRAY_DEF="$(declare -p ${1} 2>/dev/null)"
@@ -413,7 +412,7 @@ check_dep() {
fi
shift
done
- isset ONEOF && return 1 || return 0
+ isset ONEOF && return 1 || return 0
}