From e59b88bed1af1599c4f7b118f243215a985ff366 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Mon, 18 May 2020 09:45:32 +0200 Subject: New version of OBS requires different password manager. From urllib.request.HTTPPasswordMgrWithDefaultRealm to urllib.request.HTTPPasswordMgrWithPriorAuth. --- dlpcvp.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlpcvp.py b/dlpcvp.py index 259a891..69cdc95 100755 --- a/dlpcvp.py +++ b/dlpcvp.py @@ -31,13 +31,14 @@ config = configparser.ConfigParser() config.read(ConfigRCs) logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', - stream=sys.stdout, level=logging.INFO) + level=logging.INFO) log = logging.getLogger() # or HTTPPasswordMgrWithPriorAuth ? -password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() +password_mgr = urllib.request.HTTPPasswordMgrWithPriorAuth() user = config[OBS_base]['user'] passw = config[OBS_base]['pass'] +log.debug("user = {}, password = {}".format(user, passw)) password_mgr.add_password(OBS_realm, OBS_base, user, passw) auth_handler = urllib.request.HTTPBasicAuthHandler(password_mgr) @@ -64,6 +65,7 @@ def suse_packages(proj: str) -> Iterable[str]: ETag management won't work here, because I don't know about any way how to return it in iterator. """ + log.debug("url = {}".format(OBS_base + f'/source/{proj}')) req = Request(url=OBS_base + f'/source/{proj}') with open('exceptions.json') as exc_f: exc_dict = json.load(exc_f) -- cgit