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
# not existing and state != absent
#
state="present"
[ -f "$__object/parameter/state" ] && state="$(cat "$__object/parameter/state")"
state="$(cat "$__object/parameter/state")"
[ "$state" = "absent" ] && exit 0
exists="$(cat "$__object/explorer/exists")"
@ -13,8 +12,7 @@ exists="$(cat "$__object/explorer/exists")"
# Still there? Create image
#
format=qcow2
[ -f "$__object/parameter/format" ] && format="$(cat "$__object/parameter/format")"
format="$(cat "$__object/parameter/format")"
size="$(cat "$__object/parameter/size")"
diskimage="/$__object_id"

View file

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

View file

@ -0,0 +1 @@
qcow2

View file

@ -0,0 +1 @@
present

View file

@ -1 +1,2 @@
format
state