mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Make wsdl_dir path resolving more robust (#10967)
Relying on importlib to resolve the path to the wsdl directory is more robust, since it traverses all site-packages directories, that are part of the PYTHONPATH.
This commit is contained in:
parent
3788df5bc6
commit
b65656fa87
@ -1,8 +1,9 @@
|
||||
"""Configure and control camera via onvif."""
|
||||
|
||||
import logging
|
||||
import site
|
||||
from enum import Enum
|
||||
from importlib.util import find_spec
|
||||
from pathlib import Path
|
||||
|
||||
import numpy
|
||||
from onvif import ONVIFCamera, ONVIFError
|
||||
@ -50,10 +51,7 @@ class OnvifController:
|
||||
cam.onvif.port,
|
||||
cam.onvif.user,
|
||||
cam.onvif.password,
|
||||
wsdl_dir=site.getsitepackages()[0].replace(
|
||||
"dist-packages", "site-packages"
|
||||
)
|
||||
+ "/wsdl",
|
||||
wsdl_dir=Path(find_spec("onvif").origin).parent / "../wsdl",
|
||||
),
|
||||
"init": False,
|
||||
"active": False,
|
||||
|
Loading…
Reference in New Issue
Block a user