Refactor of the process for writing a hostnames and IPs file
during inventory generation.
The find_config_path is refactored as well since that was relied
upon in the implementation of the above.
To improve clarity of the file utility methods the pass_exception
parameter has been renamed and logic has been inverted.
Parent-Id: I0275eeeafeb2a4c89cd820d56dd0ad01d3124a80
Change-Id: I4c7b45f16f8ffecb91bf509daeca47b2c2450681