fixing https://github.com/saltstack/salt/commit/61573b1394c8835e8dccc91db44eeb2f7e843bd0#commitcomment-3967806
Merge pull request #6949 from ranl/hosts

fix hosts file error in Travis
Handle pip versions lower than 1.2 when parsing the package using `pip.req`.
Instantiate a logger object to log.
Added mocked pip installation test-case for when pip's version is `<=1.1`