[__lxc_container] handle $empty_conf for --no-default-config correctly
Fixed wrong variable spelling and correct check to remove the tempfile
again (forgotten from 304d974f).
This commit is contained in:
parent
6d29b0542a
commit
12a6d52a46
1 changed files with 6 additions and 4 deletions
|
|
@ -132,10 +132,11 @@ LXC
|
|||
create_opts=""
|
||||
if [ -f "$__object/parameter/no-default-config" ]; then
|
||||
# generate a random empty file and append
|
||||
# maybe work with an nonexistant file - but just be correct
|
||||
cat <<TMPFILE
|
||||
empty_conf="\$(mktemp "\${TMPDIR:-/tmp}/cdist__lxc_container-empty-conf.XXXXXXXXXX")"
|
||||
TMPFILE
|
||||
create_opts="$create_opts -f \"\$empty_config\""
|
||||
create_opts="$create_opts -f \"\$empty_conf\""
|
||||
|
||||
elif [ -f "$__object/parameter/default-config" ]; then
|
||||
# append the configuration
|
||||
|
|
@ -163,10 +164,11 @@ TMPFILE
|
|||
cat <<LXC
|
||||
lxc-create $LXC_PARAM $backingstore_opts -n "$name" -t "$template" $create_opts -- $template_opts
|
||||
LXC
|
||||
# remove empty tempfile
|
||||
if [ "$empty_config" ]; then
|
||||
|
||||
# remove empty tempfile if it was created
|
||||
if [ -f "$__object/parameter/no-default-config" ]; then
|
||||
cat <<RM
|
||||
rm -rf "$empty_config"
|
||||
rm -rf "\$empty_conf"
|
||||
RM
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue