Fixed a possible index error in the yang validator checker plugin.
- Legacy-Id: 10952
This commit is contained in:
parent
75a3895dd9
commit
e0d1c0b313
|
@ -140,7 +140,10 @@ class DraftYangChecker(object):
|
|||
for line in error_lines:
|
||||
fn, lnum, msg = line.split(':', 2)
|
||||
lnum = int(lnum)
|
||||
line = text[lnum-1].rstrip()
|
||||
if fn == model and (lnum-1) in range(len(text)):
|
||||
line = text[lnum-1].rstrip()
|
||||
else:
|
||||
line = None
|
||||
items.append((lnum, line, msg))
|
||||
if 'error: ' in msg:
|
||||
errors += 1
|
||||
|
|
Loading…
Reference in a new issue