From a02198dec0b1828b52f89f02b33b6fa06278a708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Wed, 7 Sep 2022 12:57:38 +0000 Subject: [PATCH] webdav_check logic reversal --- api/ovdashboard_api/dav_common.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/api/ovdashboard_api/dav_common.py b/api/ovdashboard_api/dav_common.py index 420bfa2..5c7a61a 100644 --- a/api/ovdashboard_api/dav_common.py +++ b/api/ovdashboard_api/dav_common.py @@ -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