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:
Joseph Hall 2013-05-03 18:49:06 -07:00
commit e4b52f8bf2

View File

@ -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