diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2020-05-18 09:45:32 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2020-05-18 09:45:32 +0200 |
commit | e59b88bed1af1599c4f7b118f243215a985ff366 (patch) | |
tree | b694c0f96b563d939ae7c78f306b58858d09a871 | |
parent | 2b7f35501dc846ffde157312ca05dde25e4dc2e4 (diff) | |
download | dlp_check_version_PyPI-master.tar.gz |
From urllib.request.HTTPPasswordMgrWithDefaultRealm to
urllib.request.HTTPPasswordMgrWithPriorAuth.
-rwxr-xr-x | dlpcvp.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |