parameter default handling in __qemu_img type corrected

This commit is contained in:
Daniel Heule 2014-01-21 22:33:10 +01:00
parent 92e67182a6
commit 02c3fe4988
5 changed files with 7 additions and 8 deletions

View file

@ -2,8 +2,7 @@
# State: absent is handled by manifest - we need only to do stuff if image is # State: absent is handled by manifest - we need only to do stuff if image is
# not existing and state != absent # not existing and state != absent
# #
state="present" state="$(cat "$__object/parameter/state")"
[ -f "$__object/parameter/state" ] && state="$(cat "$__object/parameter/state")"
[ "$state" = "absent" ] && exit 0 [ "$state" = "absent" ] && exit 0
exists="$(cat "$__object/explorer/exists")" exists="$(cat "$__object/explorer/exists")"
@ -13,8 +12,7 @@ exists="$(cat "$__object/explorer/exists")"
# Still there? Create image # Still there? Create image
# #
format=qcow2 format="$(cat "$__object/parameter/format")"
[ -f "$__object/parameter/format" ] && format="$(cat "$__object/parameter/format")"
size="$(cat "$__object/parameter/size")" size="$(cat "$__object/parameter/size")"
diskimage="/$__object_id" diskimage="/$__object_id"

View file

@ -2,10 +2,8 @@
# Default settings # Default settings
# #
format=qcow2 format="$(cat "$__object/parameter/format")"
state=present state="$(cat "$__object/parameter/state")"
[ -f "$__object/parameter/format" ] && format="$(cat "$__object/parameter/format")"
[ -f "$__object/parameter/state" ] && state="$(cat "$__object/parameter/state")"
diskimage="/$__object_id" diskimage="/$__object_id"

View file

@ -0,0 +1 @@
qcow2

View file

@ -0,0 +1 @@
present

View file

@ -1 +1,2 @@
format format
state