Extract fix_etc_hosts method

Extract the work arounds for the /etc/hosts setup on HP cloud.

Change-Id: I346f361b936b0cf1c09245f59efb61111f948b34