Skip to content

Commit f230b70

Browse files
ui: improved downloader plugin
Create the paths where the files will be downloaded.
1 parent 376b06e commit f230b70

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

ui/opensnitch/plugins/downloader/downloader.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import os.path
23
import logging
34
import requests
45
import threading
@@ -72,6 +73,9 @@ def compile(self):
7273
if url['localfile'] == "" or url['remote'] == "" or config['name'] == "":
7374
logger.debug("compile() downloader name, url, localfile, units and interval fields cannot be empty")
7475
continue
76+
localdir = os.path.dirname(url['localfile'])
77+
if not os.path.isdir(localdir):
78+
os.makedirs(localdir, 0o700)
7579

7680
self._notify = config.get('notify')
7781
if self._notify != None:

0 commit comments

Comments
 (0)