mirror of
https://github.com/openSUSE/osc.git
synced 2026-02-21 03:05:28 +01:00
Switch http requests to use http_request()
This commit is contained in:
@@ -83,7 +83,6 @@ BuildRequires: %{use_python_pkg}-devel >= 3.6
|
||||
BuildRequires: %{use_python_pkg}-rpm
|
||||
BuildRequires: %{use_python_pkg}-setuptools
|
||||
BuildRequires: %{use_python_pkg}-urllib3
|
||||
BuildRequires: %{use_python_pkg}-requests
|
||||
BuildRequires: %{yaml_pkg}
|
||||
BuildRequires: diffstat
|
||||
%if %{with fdupes}
|
||||
@@ -95,7 +94,6 @@ BuildRequires: git-core
|
||||
Requires: %{use_python_pkg}-cryptography
|
||||
Requires: %{use_python_pkg}-rpm
|
||||
Requires: %{use_python_pkg}-urllib3
|
||||
BuildRequires: %{use_python_pkg}-requests
|
||||
Requires: %{yaml_pkg}
|
||||
|
||||
# needed for git-obs completion
|
||||
|
||||
13
osc/core.py
13
osc/core.py
@@ -16,7 +16,6 @@ import locale
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import requests
|
||||
import shlex
|
||||
import shutil
|
||||
import subprocess
|
||||
@@ -1400,16 +1399,18 @@ def show_devel_project(apiurl, prj, pac):
|
||||
|
||||
package_obj = obs_api.Package.from_api(apiurl, prj, pac)
|
||||
if package_obj.devel is None:
|
||||
if prj == 'openSUSE:Factory' or prj == 'openSUSE.org:openSUSE:Factory':
|
||||
if prj == "openSUSE:Factory" or prj == "openSUSE.org:openSUSE:Factory":
|
||||
# If OBS api doesn't return a devel project, query the gitea devel_packages file
|
||||
try:
|
||||
response = requests.get(DEVEL_PACKAGES_URL)
|
||||
response = http_request("GET", DEVEL_PACKAGES_URL)
|
||||
response.auto_close = False
|
||||
except:
|
||||
return None, None
|
||||
if response.status_code == 200 and response.text:
|
||||
if response.status == 200:
|
||||
# locate pac in the devel_packages file
|
||||
for line in response.text.splitlines():
|
||||
devel_pkg, _, devel_prj = line.partition(' ')
|
||||
for line in io.TextIOWrapper(response):
|
||||
devel_pkg, _, devel_prj = line.partition(" ")
|
||||
devel_prj = devel_prj.strip()
|
||||
if devel_pkg == pac:
|
||||
# found the package, return devel project and package
|
||||
if devel_pkg and devel_prj:
|
||||
|
||||
Reference in New Issue
Block a user