webdav_check logic reversal

This commit is contained in:
Jörn-Michael Miehe 2022-09-07 12:57:38 +00:00
parent bd1d527d0e
commit a02198dec0

View file

@ -45,28 +45,26 @@ def webdav_check() -> bool:
)
sleep(30)
_logger.debug("WebDAV connection OK!")
_logger.debug("WebDAV connection ok.")
elif _WEBDAV_CLIENT.check(""):
_logger.debug("WebDAV connection OK!")
else:
elif not _WEBDAV_CLIENT.check(""):
_logger.error(
"WebDAV connection to %s FAILED!",
repr(SETTINGS.webdav.url),
)
return False
if _WEBDAV_CLIENT.check(SETTINGS.webdav_prefix):
_logger.debug("WebDAV prefix directory FOUND!")
_logger.debug("WebDAV connection ok.")
else:
if not _WEBDAV_CLIENT.check(SETTINGS.webdav_prefix):
_logger.error(
"WebDAV prefix directory %s NOT FOUND, please create it!",
repr(SETTINGS.webdav_prefix),
)
return False
_logger.debug("WebDAV prefix directory found.")
return True