deployment: Get definition prefix only if needed.

This was caused by a766271 and throws an Exception("not implemented")
even though the resource doesn't have any lines in the physical
specification.

Thanks to @rbvermaa again for testing on EC2 and finding the bug.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>