1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-22 10:12:12 +01:00

Fix build on SLE12

Fixes: #1123
Fixes: #1103
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
This commit is contained in:
Daniel Mach 2022-08-30 16:03:00 +00:00 committed by Michal Suchanek
parent d8d4b0831c
commit 9aa09ddac2
4 changed files with 13 additions and 7 deletions

View File

@ -50,7 +50,7 @@ jobs:
zypper --non-interactive --gpg-auto-import-keys refresh
zypper --non-interactive dist-upgrade
zypper --non-interactive install git-lfs
zypper --non-interactive install diffstat diffutils python3 python3-chardet python3-M2Crypto python3-pip python3-rpm python3-setuptools
zypper --non-interactive install diffstat diffutils python3 python3-M2Crypto python3-pip python3-rpm python3-setuptools
- name: 'Install packages (Fedora/CentOS)'
if: ${{ startsWith(matrix.container, 'fedora:') || contains(matrix.container, 'centos:') }}
@ -58,7 +58,7 @@ jobs:
dnf -y makecache
dnf -y distro-sync
dnf -y install git-lfs
dnf -y install diffstat diffutils python3 python3-chardet python3-m2crypto python3-pip python3-rpm python3-setuptools
dnf -y install diffstat diffutils python3 python3-m2crypto python3-pip python3-rpm python3-setuptools
- name: 'Install packages (Debian/Ubuntu)'
if: ${{ startsWith(matrix.container, 'debian:') || startsWith(matrix.container, 'ubuntu:') }}
@ -66,7 +66,7 @@ jobs:
apt-get -y update
apt-get -y upgrade
apt-get -y --no-install-recommends install git-lfs
apt-get -y --no-install-recommends install diffstat diffutils python3 python3-chardet python3-m2crypto python3-pip python3-rpm python3-setuptools
apt-get -y --no-install-recommends install diffstat diffutils python3 python3-m2crypto python3-pip python3-rpm python3-setuptools
- uses: actions/checkout@v3

View File

@ -537,7 +537,11 @@ def _build_opener(apiurl):
def http_error_401(self, req, fp, code, msg, headers):
self._rewind_request(req)
authreqs = {}
for authreq in headers.get_all('www-authenticate', []):
if hasattr(headers, "get_all"):
all_headers = headers.get_all('www-authenticate', [])
else:
all_headers = headers.getallmatchingheaders('www-authenticate')
for authreq in all_headers:
scheme = authreq.split()[0].lower()
authreqs[scheme] = authreq

View File

@ -1,3 +1,5 @@
from __future__ import print_function
import importlib
import bz2
import base64
@ -29,7 +31,6 @@ except BaseException as e:
print(msg, e, file=sys.stderr)
gnomekeyring = None
from . import conf
from . import oscerr
@ -234,6 +235,7 @@ class KeyringCredentialsManager(AbstractCredentialsManager):
keyring_backend = keyring.core.load_keyring(self._backend_cls_name)
except ModuleNotFoundError:
msg = "Invalid credentials_mgr_class: {}".format(self._backend_cls_name)
from . import conf
raise oscerr.ConfigError(msg, conf.config['conffile'])
keyring.set_keyring(keyring_backend)
@ -420,6 +422,7 @@ def create_credentials_manager(url, cp):
creds_mgr = getattr(importlib.import_module(mod), cls).create(cp, options)
except ModuleNotFoundError:
msg = "Invalid credentials_mgr_class: {}".format(creds_mgr_cls)
from . import conf
raise oscerr.ConfigError(msg, conf.config['conffile'])
return creds_mgr

View File

@ -103,7 +103,7 @@ setuptools.setup(
packages=['osc', 'osc.util'],
scripts=['osc-wrapper.py'],
data_files=data_files,
install_requires=['M2Crypto', 'chardet'],
install_requires=['M2Crypto'],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
@ -129,5 +129,4 @@ setuptools.setup(
],
# Override certain command classes with our own ones
cmdclass=cmdclass,
test_suite="tests",
)