aboutsummaryrefslogtreecommitdiffstats
path: root/anteater/src/patch_scan.py
diff options
context:
space:
mode:
authorlhinds <lhinds@redhat.com>2017-07-26 10:13:03 +0100
committerlhinds <lhinds@redhat.com>2017-07-26 10:16:36 +0100
commitea71a6990ff8f2f6f327a4416374877b0c2720e5 (patch)
tree9606aa7eee210a670dd5bf69163eec84688854f4 /anteater/src/patch_scan.py
parenta943b394faa27c651cffc827c47ea2f0da6d014e (diff)
Implements file except handler for patchsets
Simple try / except handler in the event that an edge case occurs and a patchset is not present. Change-Id: Ica5df2f5b37fff98c52f79bd2a8e47ba46890e80 Signed-off-by: lhinds <lhinds@redhat.com>
Diffstat (limited to 'anteater/src/patch_scan.py')
-rw-r--r--anteater/src/patch_scan.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/anteater/src/patch_scan.py b/anteater/src/patch_scan.py
index 1deb68f..873c069 100644
--- a/anteater/src/patch_scan.py
+++ b/anteater/src/patch_scan.py
@@ -55,8 +55,12 @@ def prepare_patchset(project, patchset):
licence_ignore = lists.licence_ignore()
# Open patch set to get file list
- fo = open(patchset, 'r')
- lines = fo.readlines()
+ try:
+ fo = open(patchset, 'r')
+ lines = fo.readlines()
+ except IOError:
+ logger.error('%s does not exist', patchset)
+ sys.exit(1)
for line in lines:
patch_file = line.strip('\n')