lxc-create: refuse to use a custom rootfs (--dir) which already exists.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Serge Hallyn 2012-12-05 10:38:07 -06:00 committed by Stéphane Graber
parent 0749e74060
commit f99c7aa5de

View File

@ -313,6 +313,10 @@ if [ -n "$custom_rootfs" ]; then
echo "configuration file already specifies a lxc.rootfs"
exit 1
fi
if [ -d "$custom_rootfs" ]; then
echo "specified rootfs ($custom_rootfs) already exists. Bailing."
exit 1
fi
echo "lxc.rootfs = $custom_rootfs" >> $lxc_path/$lxc_name/config
fi