fix csv format error
This commit is contained in:
+10
-2
@@ -10,7 +10,7 @@ from typing import Any
|
||||
from watchdog.events import FileSystemEvent, FileSystemEventHandler, FileSystemMovedEvent
|
||||
from watchdog.observers.polling import PollingObserver
|
||||
|
||||
from scanner import resolve_runtime_path, scan_results
|
||||
from scanner import resolve_runtime_path, scan_results, path_exists_with_smb
|
||||
|
||||
|
||||
LOGGER = logging.getLogger("scheduler.watcher")
|
||||
@@ -76,9 +76,15 @@ class ResultDirectoryWatcher:
|
||||
handler = _ResultDirEventHandler(self._on_new_directory)
|
||||
observer = PollingObserver(timeout=self._poll_interval_seconds)
|
||||
|
||||
smb_creds = {
|
||||
"username": new_config.smb_username,
|
||||
"password": new_config.smb_password,
|
||||
"domain": new_config.smb_domain,
|
||||
}
|
||||
|
||||
scheduled_count = 0
|
||||
for result_dir, label in ((dut_dir, "DUT"), (ref_dir, "REF")):
|
||||
if not os.path.isdir(result_dir):
|
||||
if not path_exists_with_smb(result_dir, smb_credentials=smb_creds):
|
||||
LOGGER.warning("%s result directory does not exist yet, skipping watch: %s", label, result_dir)
|
||||
continue
|
||||
observer.schedule(handler, result_dir, recursive=False)
|
||||
@@ -159,3 +165,5 @@ def _normalize_watch_path(path_value: Any) -> str:
|
||||
if not cleaned:
|
||||
return ""
|
||||
return str(resolve_runtime_path(cleaned)).strip()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user