Merge pull request #22872 from rallytime/fix_hosts_stacktrace

Prevent stacktrace on os.path.exists in hosts module
This commit is contained in:
Justin Findlay 2015-04-20 20:54:39 -06:00
commit b2bf17f5d5

View file

@ -29,6 +29,8 @@ def _get_or_create_hostfile():
does not exist.
'''
hfn = __get_hosts_filename()
if hfn is None:
hfn = ''
if not os.path.exists(hfn):
salt.utils.fopen(hfn, 'w').close()
return hfn