summaryrefslogtreecommitdiffstats
path: root/src/tools/vppapigen/vppapigen.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2020-05-19 12:33:00 +0200
committerOle Troan <ot@cisco.com>2020-05-19 13:32:47 +0200
commitdeecc93bd9a8d4fdf507659894c9850e337636e4 (patch)
treef30eb5712c9bebcde8843004ed8544205fe3a655 /src/tools/vppapigen/vppapigen.py
parente30f1e92ebb7fb42a2a06fe7ee50415eef6add1c (diff)
vppapigen: handle new api file for crcchekcer
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I1b3ae8b348eb3cba628a55ea3e72e85b9a4288d5
Diffstat (limited to 'src/tools/vppapigen/vppapigen.py')
-rwxr-xr-xsrc/tools/vppapigen/vppapigen.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/tools/vppapigen/vppapigen.py b/src/tools/vppapigen/vppapigen.py
index 2d2097904c5..06bfbff238f 100755
--- a/src/tools/vppapigen/vppapigen.py
+++ b/src/tools/vppapigen/vppapigen.py
@@ -753,8 +753,15 @@ class VPPAPI(object):
def parse_filename(self, filename, debug=0):
if self.revision:
git_show = f'git show {self.revision}:{filename}'
- with Popen(git_show.split(), stdout=PIPE, encoding='utf-8') as git:
- return self.parse_fd(git.stdout, None)
+ proc = Popen(git_show.split(), stdout=PIPE, encoding='utf-8')
+ try:
+ data, errs = proc.communicate()
+ if proc.returncode != 0:
+ print(f'File not found: {self.revision}:{filename}', file=sys.stderr)
+ sys.exit(2)
+ return self.parse_string(data, debug=debug)
+ except Exception as e:
+ sys.exit(3)
else:
try:
with open(filename, encoding='utf-8') as fd: