Skip to content

Commit a453bb4

Browse files
committed
hack: don't verify SSL for devel RH
1 parent a07ccf4 commit a453bb4

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Diff for: .snyk

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ exclude:
66
- vendor/**
77
- api/vendor/**
88
- "**/*_test.go"
9+
- hack/nmstate-version.py

Diff for: hack/nmstate-version.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,20 @@
2525
import requests
2626
from requests_kerberos import HTTPKerberosAuth
2727
import sys
28+
import urllib3
2829

2930
check_version = sys.argv[1]
3031
rhel_version = 8
3132
if float(check_version) > 4.13:
3233
rhel_version = 9
3334

35+
# Some of the URLs used below use custom CA not always present in the default Python bundle.
36+
# Skipping them and disabling warnings so that console output is not polluted.
37+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
38+
3439
base_url = 'https://errata.devel.redhat.com'
3540
start_page = base_url + f'/package/show/openshift-kubernetes-nmstate-handler-rhel-{rhel_version}-container'
36-
r = requests.get(start_page, auth=HTTPKerberosAuth())
41+
r = requests.get(start_page, auth=HTTPKerberosAuth(), verify=False)
3742
page = r.text
3843
version_re = re.compile('title=".* (\d+\.\d+\.\d+) .*".*\n.*\n.*\n.*href="(/release_engineering/show_released_build/\d+)"', flags=re.M)
3944
links = version_re.findall(page)
@@ -44,17 +49,17 @@
4449
if not version.startswith(check_version):
4550
continue
4651
# Find link to brew build
47-
build_r = requests.get(base_url + build, auth=HTTPKerberosAuth(), headers={'Accept': 'text/html'})
52+
build_r = requests.get(base_url + build, auth=HTTPKerberosAuth(), headers={'Accept': 'text/html'}, verify=False)
4853
build_page = build_r.text
4954
brew_re = re.compile('href="(https://brewweb.engineering.redhat.com/brew/buildinfo\?buildID=\d+)')
5055
brews = brew_re.findall(build_page)
5156
# Find link to x86_64.log
52-
brew_r = requests.get(brews[0])
57+
brew_r = requests.get(brews[0], verify=False)
5358
brew_page = brew_r.text
5459
log_re = re.compile('"(https://download.eng.bos.redhat.com/brewroot[^\'"]*/x86_64.log)"')
5560
logs = log_re.findall(brew_page)
5661
# Grab the NMState and NetworkManager versions from Brew logs
57-
log_r = requests.get(logs[0])
62+
log_r = requests.get(logs[0], verify=False)
5863
log_page = log_r.text
5964
nmstate_re = re.compile('Installing *: *(nmstate-\d[^ ]*)')
6065
nmstates = nmstate_re.findall(log_page)

0 commit comments

Comments
 (0)