From 2bd40a5f306e5bf536036802f4fadd45da61c825 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Thu, 29 Apr 2021 00:15:12 +0200 Subject: [PATCH] Fix -p and -u flags --- sync_url.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sync_url.py b/sync_url.py index 8b10004..8df6842 100755 --- a/sync_url.py +++ b/sync_url.py @@ -26,9 +26,10 @@ _LOGGER = logging.getLogger("sync_url") _PRETTY = PrettyLogger(_LOGGER) -def _extract_credentials(file_path: Optional[str]) -> UserPassAuthenticator: +def _extract_credentials(file_path: Optional[str], + username: Optional[str], password: Optional[str]) -> UserPassAuthenticator: if not file_path: - return UserPassAuthenticator("KIT ILIAS Shibboleth", None, None) + return UserPassAuthenticator("KIT ILIAS Shibboleth", username, password) if not Path(file_path).exists(): _PRETTY.error("Credential file does not exist") @@ -96,7 +97,7 @@ def main() -> None: "KIT ILIAS Shibboleth", username=args.username, password=args.password ) else: - inner_auth = _extract_credentials(args.credential_file) + inner_auth = _extract_credentials(args.credential_file, args.username, args.password) username, password = inner_auth.get_credentials() authenticator = KitShibbolethAuthenticator(inner_auth)