summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch
diff options
context:
space:
mode:
authorWang Mingyu <wangmy@fujitsu.com>2023-02-11 21:33:22 +0800
committerKhem Raj <raj.khem@gmail.com>2023-02-12 08:56:16 -0800
commit21a69c4c90303e334cf0679251c82c8035afb32d (patch)
tree47b62ccc76e9741458c414221899ee4afa5b96dc /meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch
parentde0bda3f7e8a27ce4e8644a7c430126489517fd2 (diff)
downloadmeta-openembedded-21a69c4c90303e334cf0679251c82c8035afb32d.tar.gz
python3-pykickstart: upgrade 3.34 -> 3.43
0001-support-authentication-for-kickstart.patch 0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch 0004-load.py-retry-to-invoke-request-with-timeout.patch refreshed for new version. Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch')
-rw-r--r--meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch18
1 files changed, 10 insertions, 8 deletions
diff --git a/meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch b/meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch
index bf5a197230..b09bb74df8 100644
--- a/meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch
+++ b/meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch
@@ -11,19 +11,18 @@ network is up, the fetch works.
11Upstream-Status: inappropriate [oe specific] 11Upstream-Status: inappropriate [oe specific]
12 12
13Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 13Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
14
15--- 14---
16 pykickstart/load.py | 31 +++++++++++++++++++++++++++++++ 15 pykickstart/load.py | 31 +++++++++++++++++++++++++++++++
17 1 file changed, 31 insertions(+) 16 1 file changed, 31 insertions(+)
18 17
19diff --git a/pykickstart/load.py b/pykickstart/load.py 18diff --git a/pykickstart/load.py b/pykickstart/load.py
20index f75fe5d3..a8f3ed1d 100644 19index 58faba6..e856c8d 100644
21--- a/pykickstart/load.py 20--- a/pykickstart/load.py
22+++ b/pykickstart/load.py 21+++ b/pykickstart/load.py
23@@ -21,12 +21,16 @@ import requests 22@@ -20,12 +20,16 @@
23 import requests
24 from requests.auth import HTTPDigestAuth 24 from requests.auth import HTTPDigestAuth
25 from requests.auth import HTTPBasicAuth 25 from requests.auth import HTTPBasicAuth
26
27+import time 26+import time
28 import shutil 27 import shutil
29 28
@@ -34,10 +33,10 @@ index f75fe5d3..a8f3ed1d 100644
34+import logging 33+import logging
35+log = logging.getLogger("anaconda.main") 34+log = logging.getLogger("anaconda.main")
36+ 35+
37 _is_url = lambda location: '://' in location # RFC 3986 36 is_url = lambda location: '://' in location # RFC 3986
38 37
39 SSL_VERIFY = False 38 SSL_VERIFY = False
40@@ -72,6 +76,29 @@ def load_to_file(location, destination): 39@@ -71,6 +75,29 @@ def load_to_file(location, destination):
41 _copy_file(location, destination) 40 _copy_file(location, destination)
42 return destination 41 return destination
43 42
@@ -67,7 +66,7 @@ index f75fe5d3..a8f3ed1d 100644
67 def _get_auth(location, user=None, passwd=None): 66 def _get_auth(location, user=None, passwd=None):
68 67
69 auth = None 68 auth = None
70@@ -93,6 +120,10 @@ def _get_auth(location, user=None, passwd=None): 69@@ -92,6 +119,10 @@ def _get_auth(location, user=None, passwd=None):
71 70
72 def _load_url(location, user=None, passwd=None): 71 def _load_url(location, user=None, passwd=None):
73 '''Load a location (URL or filename) and return contents as string''' 72 '''Load a location (URL or filename) and return contents as string'''
@@ -76,5 +75,8 @@ index f75fe5d3..a8f3ed1d 100644
76+ raise KickstartError(_("Connection %s failed" % location)) 75+ raise KickstartError(_("Connection %s failed" % location))
77+ 76+
78 auth = _get_auth(location, user=user, passwd=passwd) 77 auth = _get_auth(location, user=user, passwd=passwd)
78
79 try: 79 try:
80 request = requests.get(location, verify=SSL_VERIFY, auth=auth) 80--
812.34.1
82