mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix infinite loop introduced by #20124 when the init system is not in the supported_inits list
This commit is contained in:
parent
0c7fa0fca2
commit
4d0061b832
1 changed files with 3 additions and 1 deletions
|
@ -1046,14 +1046,16 @@ def os_data():
|
|||
with open(init_bin, 'rb') as fp_:
|
||||
buf = True
|
||||
edge = ''
|
||||
buf = fp_.read(buf_size).lower()
|
||||
while buf:
|
||||
buf = edge + fp_.read(buf_size).lower()
|
||||
buf = edge + buf
|
||||
for item in supported_inits:
|
||||
if item in buf:
|
||||
grains['init'] = item
|
||||
buf = ''
|
||||
break
|
||||
edge = buf[-edge_len:]
|
||||
buf = fp_.read(buf_size).lower()
|
||||
except (IOError, OSError) as exc:
|
||||
log.error(
|
||||
'Unable to read from init_bin ({0}): {1}'
|
||||
|
|
Loading…
Add table
Reference in a new issue