mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Merge pull request #4810 from hulu/grub-legacy-cleanup
grub_legacy module: use actual bool and rename var for clarity
This commit is contained in:
commit
e4b52f8bf2
@ -54,7 +54,7 @@ def conf():
|
||||
'''
|
||||
stanza = ''
|
||||
stanzas = []
|
||||
instanza = 0
|
||||
in_stanza = False
|
||||
ret = {}
|
||||
pos = 0
|
||||
try:
|
||||
@ -63,7 +63,7 @@ def conf():
|
||||
if line.startswith('#'):
|
||||
continue
|
||||
if line.startswith('\n'):
|
||||
instanza = 0
|
||||
in_stanza = False
|
||||
if 'title' in stanza:
|
||||
stanza += 'order {0}'.format(pos)
|
||||
pos += 1
|
||||
@ -71,13 +71,13 @@ def conf():
|
||||
stanza = ''
|
||||
continue
|
||||
if line.startswith('title'):
|
||||
instanza = 1
|
||||
if instanza == 1:
|
||||
in_stanza = True
|
||||
if in_stanza:
|
||||
stanza += line
|
||||
if instanza == 0:
|
||||
if not in_stanza:
|
||||
key, value = _parse_line(line)
|
||||
ret[key] = value
|
||||
if instanza == 1:
|
||||
if in_stanza:
|
||||
if not line.endswith('\n'):
|
||||
line += '\n'
|
||||
stanza += line
|
||||
|
Loading…
Reference in New Issue
Block a user