Skip to content

Commit b518fb3

Browse files
committed
HACK to fix bug in parsing of Ansible code in last line
1 parent 8469c13 commit b518fb3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

glitch/parsers/cmof.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def __parse_playbook(self, name, file, parsed_file = None) -> UnitBlock:
230230
unit_block.path = file.name
231231
file.seek(0, 0)
232232
code = file.readlines()
233+
code.append("") # HACK allows to parse code in the end of the file
233234

234235
for p in parsed_file.value:
235236
# Plays are unit blocks inside a unit block
@@ -266,6 +267,7 @@ def __parse_tasks_file(self, name, file, parsed_file = None) -> UnitBlock:
266267
unit_block.path = file.name
267268
file.seek(0, 0)
268269
code = file.readlines()
270+
code.append("") # HACK allows to parse code in the end of the file
269271

270272
if parsed_file is None:
271273
return unit_block
@@ -289,6 +291,7 @@ def __parse_vars_file(self, name, file, parsed_file=None) -> UnitBlock:
289291
unit_block.path = file.name
290292
file.seek(0, 0)
291293
code = file.readlines()
294+
code.append("") # HACK allows to parse code in the end of the file
292295

293296
if parsed_file is None:
294297
return unit_block

0 commit comments

Comments
 (0)