Moved exception raising to get_localhoist_ip

Change-Id: If2a55b844d3c6678d37a1f2598df0f229956d0d9
Fixes: rhbz#977281
Merge "Moved exception raising to get_localhoist_ip"