undertaker/python: ported to stderr messages

This commit is contained in:
boyska 2012-01-29 16:16:06 +01:00
parent 4d24e247aa
commit 17c0478240
2 changed files with 6 additions and 6 deletions

View File

@ -36,7 +36,7 @@ class Undertaker(object):
buf = NamedTemporaryFile()
try:
subprocess.check_call([cls.undertakerexec, paths, '--batch',
'--path'], stdout=buf)
'--path'], stderr=buf)
except subprocess.CalledProcessError as exc:
return False

View File

@ -32,15 +32,15 @@ TRAPSTOP() die "STOP signal caught, undertaker aborting."
# first of all source the tomb core functions
which tomb > /dev/null
if [[ $? != 0 ]]; then
print "$fg[red][!]$fg[white] Tomb command not found, operation aborted."; exit 1
print "$fg[red][!]$fg[white] Tomb command not found, operation aborted." >&2; exit 1
fi
key_found() {
# $1 is "url"
if option_is_set --batch; then
print -n '[m]'
print -n '[m]' >&2
fi
print "$fg[white][found] $1"
print "$fg[white][found] $1" >&2
}
@ -162,8 +162,8 @@ function main() {
typeset -A opts
zparseopts -M -E -D -Aopts -poll -path -batch
if ! [ $1 ] ; then
echo "[W] an argument is missing, the undertaker is confused"
echo "usage: undertaker [options] url://host:path/to/tomb.key"
print "[W] an argument is missing, the undertaker is confused" >&2
print "usage: undertaker [options] url://host:path/to/tomb.key" >&2
exit 1;
fi
local -a tomb_opts