Permalink
Browse files

OS-1703 mdata-get should write errors and diagnostics to stderr.

  • Loading branch information...
1 parent e52e75a commit 5911c2048a928b501d47f116f452f4cd067d41b3 @joshwilsdon joshwilsdon committed Dec 3, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 overlay/generic/usr/sbin/mdata-get
@@ -5,7 +5,7 @@
key=$1
if [[ -z ${key} ]]; then
- echo "Usage: $0 <key>"
+ echo "Usage: $0 <key>" >&2
exit 1
fi
@@ -24,7 +24,7 @@ case $(uname -s) in
DISABLE_ECHO="no"
;;
*)
- echo "Don't know which serial to use for $(uname -s)"
+ echo "Don't know which serial to use for $(uname -s)" >&2
exit 1
;;
esac
@@ -46,10 +46,10 @@ echo "GET ${key}" >&3
# First line will be a status.
read status
if [[ ${status} == "NOTFOUND" ]]; then
- echo "No metadata for ${key}"
+ echo "No metadata for ${key}" >&2
exit 1
elif [[ ${status} != "SUCCESS" ]]; then
- echo "Error getting metadata for key ${key}: ${status}"
+ echo "Error getting metadata for key ${key}: ${status}" >&2
exit 2
fi

0 comments on commit 5911c20

Please sign in to comment.