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:
self.logger.error(e.output, extra={'entity': self.current_owner})
exit(2)
try:
with open(self.label_file) as labelFile:
self.labels = []
labels = labelFile.read().splitlines()
for label in filter(None, labels):
self.labels.append(label)
except OSError as e:
self.logger.error(
e.strerror,
extra={'entity': self.current_owner}
)
exit(2)
except TypeError as e:
pass
if hasattr(self, 'label_file'):
try:
with open(self.label_file) as labelFile:
self.labels = []
labels = labelFile.read().splitlines()
for label in filter(None, labels):
self.labels.append(label)
except OSError as e:
self.logger.error(
e.strerror,
extra={'entity': self.current_owner}
)
exit(2)
except TypeError as e:
pass
if len(self.labels) < 1:
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