cdist/cdist/conf/type/__qemu_img/manifest
Nico Schottelius b7f8b5e339 catch unsupported state cases in __dog_vdi und __qemu_img
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
2014-03-31 21:22:15 +02:00

25 lines
628 B
Text

################################################################################
# Default settings
#
format="$(cat "$__object/parameter/format")"
state_should="$(cat "$__object/parameter/state")"
diskimage="/$__object_id"
case "$state_should" in
present)
if [ ! -f "$__object/parameter/size" ]; then
echo "Size is required when state is present" >&2
exit 1
fi
;;
absent)
# Absent is ensured by __file, present by gencode-remote
__file "$diskimage" --state absent
;;
*)
echo "Unsupported state: $state_should" >&2
exit 1
;;
esac