diff --git a/salt/modules/grub_legacy.py b/salt/modules/grub_legacy.py index 5433fd54c6..c48d87d0f3 100644 --- a/salt/modules/grub_legacy.py +++ b/salt/modules/grub_legacy.py @@ -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