#!/bin/sh
# Mock of build-openstack-debian-image for the ikvswitch-setup tests:
# it records the arguments it was called with in the file pointed to
# by IKV_MOCK_BODI_LOG, and creates the raw image requested by
# --output (the script runs it from the templates directory), so that
# ikvswitch-setup finds its template and keeps going.

OUT=""
ARGS="$@"
while [ -n "${1}" ] ; do
	case "${1}" in
	"--output")
		OUT="${2}"
		shift
		shift
	;;
	*)
		shift
	;;
	esac
done

echo ${ARGS} >>${IKV_MOCK_BODI_LOG}
if [ -n "${OUT}" ] ; then
	touch ./${OUT}.raw
fi

exit 0
