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:
parent
d8d4b0831c
commit
9aa09ddac2
6
.github/workflows/unittests.yaml
vendored
6
.github/workflows/unittests.yaml
vendored
@ -50,7 +50,7 @@ jobs:
|
|||||||
zypper --non-interactive --gpg-auto-import-keys refresh
|
zypper --non-interactive --gpg-auto-import-keys refresh
|
||||||
zypper --non-interactive dist-upgrade
|
zypper --non-interactive dist-upgrade
|
||||||
zypper --non-interactive install git-lfs
|
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)'
|
- name: 'Install packages (Fedora/CentOS)'
|
||||||
if: ${{ startsWith(matrix.container, 'fedora:') || contains(matrix.container, 'centos:') }}
|
if: ${{ startsWith(matrix.container, 'fedora:') || contains(matrix.container, 'centos:') }}
|
||||||
@ -58,7 +58,7 @@ jobs:
|
|||||||
dnf -y makecache
|
dnf -y makecache
|
||||||
dnf -y distro-sync
|
dnf -y distro-sync
|
||||||
dnf -y install git-lfs
|
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)'
|
- name: 'Install packages (Debian/Ubuntu)'
|
||||||
if: ${{ startsWith(matrix.container, 'debian:') || startsWith(matrix.container, 'ubuntu:') }}
|
if: ${{ startsWith(matrix.container, 'debian:') || startsWith(matrix.container, 'ubuntu:') }}
|
||||||
@ -66,7 +66,7 @@ jobs:
|
|||||||
apt-get -y update
|
apt-get -y update
|
||||||
apt-get -y upgrade
|
apt-get -y upgrade
|
||||||
apt-get -y --no-install-recommends install git-lfs
|
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
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
@ -537,7 +537,11 @@ def _build_opener(apiurl):
|
|||||||
def http_error_401(self, req, fp, code, msg, headers):
|
def http_error_401(self, req, fp, code, msg, headers):
|
||||||
self._rewind_request(req)
|
self._rewind_request(req)
|
||||||
authreqs = {}
|
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()
|
scheme = authreq.split()[0].lower()
|
||||||
authreqs[scheme] = authreq
|
authreqs[scheme] = authreq
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
import bz2
|
import bz2
|
||||||
import base64
|
import base64
|
||||||
@ -29,7 +31,6 @@ except BaseException as e:
|
|||||||
print(msg, e, file=sys.stderr)
|
print(msg, e, file=sys.stderr)
|
||||||
gnomekeyring = None
|
gnomekeyring = None
|
||||||
|
|
||||||
from . import conf
|
|
||||||
from . import oscerr
|
from . import oscerr
|
||||||
|
|
||||||
|
|
||||||
@ -234,6 +235,7 @@ class KeyringCredentialsManager(AbstractCredentialsManager):
|
|||||||
keyring_backend = keyring.core.load_keyring(self._backend_cls_name)
|
keyring_backend = keyring.core.load_keyring(self._backend_cls_name)
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
msg = "Invalid credentials_mgr_class: {}".format(self._backend_cls_name)
|
msg = "Invalid credentials_mgr_class: {}".format(self._backend_cls_name)
|
||||||
|
from . import conf
|
||||||
raise oscerr.ConfigError(msg, conf.config['conffile'])
|
raise oscerr.ConfigError(msg, conf.config['conffile'])
|
||||||
keyring.set_keyring(keyring_backend)
|
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)
|
creds_mgr = getattr(importlib.import_module(mod), cls).create(cp, options)
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
msg = "Invalid credentials_mgr_class: {}".format(creds_mgr_cls)
|
msg = "Invalid credentials_mgr_class: {}".format(creds_mgr_cls)
|
||||||
|
from . import conf
|
||||||
raise oscerr.ConfigError(msg, conf.config['conffile'])
|
raise oscerr.ConfigError(msg, conf.config['conffile'])
|
||||||
return creds_mgr
|
return creds_mgr
|
||||||
|
|
||||||
|
3
setup.py
3
setup.py
@ -103,7 +103,7 @@ setuptools.setup(
|
|||||||
packages=['osc', 'osc.util'],
|
packages=['osc', 'osc.util'],
|
||||||
scripts=['osc-wrapper.py'],
|
scripts=['osc-wrapper.py'],
|
||||||
data_files=data_files,
|
data_files=data_files,
|
||||||
install_requires=['M2Crypto', 'chardet'],
|
install_requires=['M2Crypto'],
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Development Status :: 5 - Production/Stable",
|
"Development Status :: 5 - Production/Stable",
|
||||||
"Environment :: Console",
|
"Environment :: Console",
|
||||||
@ -129,5 +129,4 @@ setuptools.setup(
|
|||||||
],
|
],
|
||||||
# Override certain command classes with our own ones
|
# Override certain command classes with our own ones
|
||||||
cmdclass=cmdclass,
|
cmdclass=cmdclass,
|
||||||
test_suite="tests",
|
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user