Skip to content

Commit

Permalink
Remove check_if_monitored_dir_exist
Browse files Browse the repository at this point in the history
  • Loading branch information
tecnavia-dev committed May 24, 2023
1 parent 1094446 commit 6bb2de7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions pytroll_collectors/trollstalker.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,12 @@ def create_notifier(topic, instrument, posttroll_port, filepattern,

# Add directories and event masks to watch manager
for monitored_dir in monitored_dirs:
# Create directory, if it does not exist
check_if_monitored_dir_exist(monitored_dir)
os.makedirs(monitored_dir, exist_ok=True)
manager.add_watch(monitored_dir, event_mask, rec=True)

return notifier


def check_if_monitored_dir_exist(directory):
"""Create directory, if it does not exist."""
try:
os.makedirs(directory, exist_ok=True)
except PermissionError as err:
logger.error(f"Can't create monitored directory: {err}")
raise


def parse_vars(config):
"""Parse custom variables from the config.
Expand Down

0 comments on commit 6bb2de7

Please sign in to comment.