1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

bug #867: Minor change to du function

This commit is contained in:
Ruben S. Montero 2011-10-19 23:04:15 +02:00
parent dfa237b2ee
commit ee76f711fd

View File

@ -41,19 +41,15 @@ echo "$IMAGE_REPOSITORY_PATH/`echo $CANONICAL_MD5 | cut -d ' ' -f1`"
}
function fs_du {
SIZE=""
QEMU_IMG=`command -v qemu-img`
if [ "$?" = "0" ]; then
if [ $? = 0 ]; then
SIZE=$($QEMU_IMG info $1|awk '/^virtual size:/{print substr($4,2)}')
fi
if [ -z "$SIZE" ]; then
else
SIZE=$(stat -c %s $1)
fi
SIZE=$(($SIZE/1048576))
echo "$SIZE"
}
}