mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #22872 from rallytime/fix_hosts_stacktrace
Prevent stacktrace on os.path.exists in hosts module
This commit is contained in:
commit
b2bf17f5d5
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue