lxc-ubuntu-cloud: get full pathname to userdata file

When passing '--userdata somefile' to the ubuntu-cloud template, a user
may pass a relative pathname.  The template uses the filename after
changing current directory, so store the full pathname for the userdata
file instead of a potential relative pathname.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Serge Hallyn 2012-08-30 11:02:24 -05:00 committed by Stéphane Graber
parent e7f40d8aab
commit 10f73bfa4a

View File

@ -221,9 +221,13 @@ if [ "$stream" != "daily" -a "$stream" != "released" ]; then
exit 1
fi
if [ -n "$userdata" -a ! -f "$userdata" ]; then
echo "Userdata does not exist"
exit 1
if [ -n "$userdata" ]; then
if [ ! -f "$userdata" ]; then
echo "Userdata ($userdata) does not exist"
exit 1
else
userdata=`readlink -f $userdata`
fi
fi
if [ -z "$path" ]; then