Skip to content

Commit f52e21f

Browse files
committed
Put a guard in the yang validator against trying to read a draft which is absent from the staging area.
- Legacy-Id: 10958
1 parent 96d62b8 commit f52e21f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

ietf/submit/checkers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,13 @@ class DraftYangChecker(object):
111111
def check_file_txt(self, path):
112112
name = os.path.basename(path)
113113
workdir = tempfile.mkdtemp()
114+
errors = []
115+
warnings = []
114116
results = {}
115117

116118
extractor = xym.YangModuleExtractor(path, workdir, strict=True, debug_level = 0)
119+
if not os.path.exists(path):
120+
return None, "%s: No such file or directory: '%s'"%(name.capitalize(), path), errors, warnings, results
117121
with open(path) as file:
118122
try:
119123
# This places the yang models as files in workdir

0 commit comments

Comments
 (0)