From f52e21fb1733672ac70990492b4011a786660ef8 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Mon, 21 Mar 2016 11:42:06 +0000 Subject: [PATCH] Put a guard in the yang validator against trying to read a draft which is absent from the staging area. - Legacy-Id: 10958 --- ietf/submit/checkers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ietf/submit/checkers.py b/ietf/submit/checkers.py index 02640ec26..4d3bfb150 100644 --- a/ietf/submit/checkers.py +++ b/ietf/submit/checkers.py @@ -111,9 +111,13 @@ class DraftYangChecker(object): def check_file_txt(self, path): name = os.path.basename(path) workdir = tempfile.mkdtemp() + errors = [] + warnings = [] results = {} extractor = xym.YangModuleExtractor(path, workdir, strict=True, debug_level = 0) + if not os.path.exists(path): + return None, "%s: No such file or directory: '%s'"%(name.capitalize(), path), errors, warnings, results with open(path) as file: try: # This places the yang models as files in workdir