Commit d6571524 authored by Rob Carleski's avatar Rob Carleski 🇮🇸
Browse files

Fix bad check for label file.

parent 6bd0e61e
...@@ -36,20 +36,21 @@ class Mover: ...@@ -36,20 +36,21 @@ class Mover:
self.logger.error(e.output, extra={'entity': self.current_owner}) self.logger.error(e.output, extra={'entity': self.current_owner})
exit(2) exit(2)
try: if hasattr(self, 'label_file'):
with open(self.label_file) as labelFile: try:
self.labels = [] with open(self.label_file) as labelFile:
labels = self.labels = []
for label in filter(None, labels): labels =
self.labels.append(label) for label in filter(None, labels):
except OSError as e: self.labels.append(label)
self.logger.error( except OSError as e:
e.strerror, self.logger.error(
extra={'entity': self.current_owner} e.strerror,
) extra={'entity': self.current_owner}
exit(2) )
except TypeError as e: exit(2)
pass except TypeError as e:
if len(self.labels) < 1: if len(self.labels) < 1:
self.logger.error( self.logger.error(
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment