Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-image
Commits
e7cbe965
Commit
e7cbe965
authored
Nov 07, 2011
by
Nikos Skalkotos
Browse files
Add code to make task exclusion possible
parent
a5dbdff8
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-image-helper/common.sh
View file @
e7cbe965
...
...
@@ -159,8 +159,22 @@ cleanup() {
fi
}
trap
cleanup EXIT
check_if_excluded
()
{
trap
cleanup EXIT
test
"
$PROGNAME
"
=
"snf-image-helper"
&&
return
0
eval local
do_exclude
=
\$
SNF_IMAGE_EXCLUDE_
${
PROGNAME
:2
}
_TASK
if
[
-n
"
$do_exclude
"
]
;
then
warn
"Task
$PROGNAME
was excluded and will not run."
exit
0
fi
return
0
}
# Check if the execution of a task should be ommited
check_if_excluded
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
snf-image-helper/snf-image-helper.in
View file @
e7cbe965
...
...
@@ -79,13 +79,15 @@ fi
# in case it is left mounted...
trap
'{ umount "$target"; }'
ERR
# Redirect standard error to standard output,
# prepend a timestamp before each line of output.
echo
"Execute all snf-image tasks...."
$RUN_PARTS
-v
--exit-on-error
"@tasksdir@"
2>&1|
while
IFS
=
read
-r
line
;
do
echo
$(
date
+%Y:%m:%d-%H:%M:%S.%N
)
"
$line
"
done
if
[
-z
"
$SNF_IMAGE_EXCLUDE_ALL_TASKS
"
]
;
then
# Redirect standard error to standard output,
# prepend a timestamp before each line of output.
echo
"Execute all snf-image tasks...."
$RUN_PARTS
-v
--exit-on-error
"@tasksdir@"
2>&1|
while
IFS
=
read
-r
line
;
do
echo
$(
date
+%Y:%m:%d-%H:%M:%S.%N
)
"
$line
"
done
fi
# Disable the trap. If code reaches here, the filesystem is unmounted.
trap
- ERR
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment