summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch35
-rw-r--r--meta-python/recipes-extended/python-pykickstart/files/0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch17
-rw-r--r--meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch18
-rw-r--r--meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.43.bb (renamed from meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.34.bb)2
4 files changed, 38 insertions, 34 deletions
diff --git a/meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch b/meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch
index 5f95d74bf1..23a06bf622 100644
--- a/meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch
+++ b/meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch
@@ -12,15 +12,14 @@ which the invoker could parse this specific error.
12Upstream-Status: inappropriate [oe specific] 12Upstream-Status: inappropriate [oe specific]
13 13
14Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 14Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
15
16--- 15---
17 pykickstart/errors.py | 17 +++++++++++++++++ 16 pykickstart/errors.py | 17 +++++++++++++++++
18 pykickstart/load.py | 34 ++++++++++++++++++++++++++++------ 17 pykickstart/load.py | 32 +++++++++++++++++++++++++++-----
19 pykickstart/parser.py | 4 ++-- 18 pykickstart/parser.py | 4 ++--
20 3 files changed, 47 insertions(+), 8 deletions(-) 19 3 files changed, 46 insertions(+), 7 deletions(-)
21 20
22diff --git a/pykickstart/errors.py b/pykickstart/errors.py 21diff --git a/pykickstart/errors.py b/pykickstart/errors.py
23index 8294f59a..3d20bf82 100644 22index 8294f59..3d20bf8 100644
24--- a/pykickstart/errors.py 23--- a/pykickstart/errors.py
25+++ b/pykickstart/errors.py 24+++ b/pykickstart/errors.py
26@@ -32,6 +32,9 @@ This module exports several exception classes: 25@@ -32,6 +32,9 @@ This module exports several exception classes:
@@ -52,16 +51,15 @@ index 8294f59a..3d20bf82 100644
52+ def __str__(self): 51+ def __str__(self):
53+ return self.value 52+ return self.value
54diff --git a/pykickstart/load.py b/pykickstart/load.py 53diff --git a/pykickstart/load.py b/pykickstart/load.py
55index 30e2fcfa..b984876d 100644 54index eb76b65..f51cf08 100644
56--- a/pykickstart/load.py 55--- a/pykickstart/load.py
57+++ b/pykickstart/load.py 56+++ b/pykickstart/load.py
58@@ -18,9 +18,12 @@ 57@@ -18,9 +18,11 @@
59 # with the express permission of Red Hat, Inc. 58 # with the express permission of Red Hat, Inc.
60 # 59 #
61 import requests 60 import requests
62+from requests.auth import HTTPDigestAuth 61+from requests.auth import HTTPDigestAuth
63+from requests.auth import HTTPBasicAuth 62+from requests.auth import HTTPBasicAuth
64+
65 import shutil 63 import shutil
66 64
67-from pykickstart.errors import KickstartError 65-from pykickstart.errors import KickstartError
@@ -69,7 +67,7 @@ index 30e2fcfa..b984876d 100644
69 from pykickstart.i18n import _ 67 from pykickstart.i18n import _
70 from requests.exceptions import SSLError, RequestException 68 from requests.exceptions import SSLError, RequestException
71 69
72@@ -28,7 +31,7 @@ _is_url = lambda location: '://' in location # RFC 3986 70@@ -28,7 +30,7 @@ is_url = lambda location: '://' in location # RFC 3986
73 71
74 SSL_VERIFY = True 72 SSL_VERIFY = True
75 73
@@ -78,21 +76,20 @@ index 30e2fcfa..b984876d 100644
78 '''Load a destination URL or file into a string. 76 '''Load a destination URL or file into a string.
79 Type of input is inferred automatically. 77 Type of input is inferred automatically.
80 78
81@@ -39,7 +42,7 @@ def load_to_str(location): 79@@ -39,7 +41,7 @@ def load_to_str(location):
82 Raises: KickstartError on error reading''' 80 Raises: KickstartError on error reading'''
83 81
84 if _is_url(location): 82 if is_url(location):
85- return _load_url(location) 83- return _load_url(location)
86+ return _load_url(location, user=user, passwd=passwd) 84+ return _load_url(location, user=user, passwd=passwd)
87 else: 85 else:
88 return _load_file(location) 86 return _load_file(location)
89 87
90@@ -69,11 +72,30 @@ def load_to_file(location, destination): 88@@ -69,11 +71,31 @@ def load_to_file(location, destination):
91 _copy_file(location, destination) 89 _copy_file(location, destination)
92 return destination 90 return destination
93 91
94-def _load_url(location): 92-def _load_url(location):
95- '''Load a location (URL or filename) and return contents as string'''
96+def _get_auth(location, user=None, passwd=None): 93+def _get_auth(location, user=None, passwd=None):
97+ 94+
98+ auth = None 95+ auth = None
@@ -101,7 +98,7 @@ index 30e2fcfa..b984876d 100644
101+ if user is None or passwd is None: 98+ if user is None or passwd is None:
102+ log.info("Require Authentication") 99+ log.info("Require Authentication")
103+ raise KickstartAuthError("Require Authentication.\nAppend 'ksuser=<username> kspasswd=<password>' to boot command") 100+ raise KickstartAuthError("Require Authentication.\nAppend 'ksuser=<username> kspasswd=<password>' to boot command")
104 101+
105+ reasons = request.headers.get("WWW-Authenticate", "").split() 102+ reasons = request.headers.get("WWW-Authenticate", "").split()
106+ if reasons: 103+ if reasons:
107+ auth_type = reasons[0] 104+ auth_type = reasons[0]
@@ -113,8 +110,9 @@ index 30e2fcfa..b984876d 100644
113+ return auth 110+ return auth
114+ 111+
115+def _load_url(location, user=None, passwd=None): 112+def _load_url(location, user=None, passwd=None):
116+ '''Load a location (URL or filename) and return contents as string''' 113 '''Load a location (URL or filename) and return contents as string'''
117+ auth = _get_auth(location, user=user, passwd=passwd) 114+ auth = _get_auth(location, user=user, passwd=passwd)
115
118 try: 116 try:
119- request = requests.get(location, verify=SSL_VERIFY) 117- request = requests.get(location, verify=SSL_VERIFY)
120+ request = requests.get(location, verify=SSL_VERIFY, auth=auth) 118+ request = requests.get(location, verify=SSL_VERIFY, auth=auth)
@@ -122,10 +120,10 @@ index 30e2fcfa..b984876d 100644
122 raise KickstartError(_('Error securely accessing URL "%s"') % location + ': {e}'.format(e=str(e))) 120 raise KickstartError(_('Error securely accessing URL "%s"') % location + ': {e}'.format(e=str(e)))
123 except RequestException as e: 121 except RequestException as e:
124diff --git a/pykickstart/parser.py b/pykickstart/parser.py 122diff --git a/pykickstart/parser.py b/pykickstart/parser.py
125index b23e54f1..e10f06b5 100644 123index 7edf8aa..46c5299 100644
126--- a/pykickstart/parser.py 124--- a/pykickstart/parser.py
127+++ b/pykickstart/parser.py 125+++ b/pykickstart/parser.py
128@@ -796,7 +796,7 @@ class KickstartParser(object): 126@@ -790,7 +790,7 @@ class KickstartParser(object):
129 i = PutBackIterator(s.splitlines(True) + [""]) 127 i = PutBackIterator(s.splitlines(True) + [""])
130 self._stateMachine(i) 128 self._stateMachine(i)
131 129
@@ -134,7 +132,7 @@ index b23e54f1..e10f06b5 100644
134 """Process a kickstart file, given by the filename f.""" 132 """Process a kickstart file, given by the filename f."""
135 if reset: 133 if reset:
136 self._reset() 134 self._reset()
137@@ -817,7 +817,7 @@ class KickstartParser(object): 135@@ -811,7 +811,7 @@ class KickstartParser(object):
138 self.currentdir[self._includeDepth] = cd 136 self.currentdir[self._includeDepth] = cd
139 137
140 try: 138 try:
@@ -143,3 +141,6 @@ index b23e54f1..e10f06b5 100644
143 except KickstartError as e: 141 except KickstartError as e:
144 raise KickstartError(_("Unable to open input kickstart file: %s") % str(e), lineno=0) 142 raise KickstartError(_("Unable to open input kickstart file: %s") % str(e), lineno=0)
145 143
144--
1452.34.1
146
diff --git a/meta-python/recipes-extended/python-pykickstart/files/0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch b/meta-python/recipes-extended/python-pykickstart/files/0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch
index 4a001f3386..5e0d6166fa 100644
--- a/meta-python/recipes-extended/python-pykickstart/files/0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch
+++ b/meta-python/recipes-extended/python-pykickstart/files/0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch
@@ -1,7 +1,7 @@
1From 62fdead139edb0f29b2f222efcb8f39be15b057e Mon Sep 17 00:00:00 2001 1From 62fdead139edb0f29b2f222efcb8f39be15b057e Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Mon, 30 Jul 2018 15:47:13 +0800 3Date: Mon, 30 Jul 2018 15:47:13 +0800
4Subject: [PATCH 2/4] pykickstart/parser.py: add lock for readKickstart and 4Subject: [PATCH 2/4] pykickstart/parser.py: add lock for readKickstart and
5 support https without certification 5 support https without certification
6 6
7- Add lock for readKickstart to fix race issue 7- Add lock for readKickstart to fix race issue
@@ -9,18 +9,19 @@ Subject: [PATCH 2/4] pykickstart/parser.py: add lock for readKickstart and
9- Support to download kickstart file through https without certification 9- Support to download kickstart file through https without certification
10 10
11Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 11Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
12Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
12--- 13---
13 pykickstart/load.py | 2 +- 14 pykickstart/load.py | 2 +-
14 pykickstart/parser.py | 18 ++++++++++++++++++ 15 pykickstart/parser.py | 18 ++++++++++++++++++
15 2 files changed, 19 insertions(+), 1 deletion(-) 16 2 files changed, 19 insertions(+), 1 deletion(-)
16 17
17diff --git a/pykickstart/load.py b/pykickstart/load.py 18diff --git a/pykickstart/load.py b/pykickstart/load.py
18index c6f013f..7adb751 100644 19index 8da8051..e856c8d 100644
19--- a/pykickstart/load.py 20--- a/pykickstart/load.py
20+++ b/pykickstart/load.py 21+++ b/pykickstart/load.py
21@@ -30,7 +30,7 @@ from requests.exceptions import SSLError, RequestException 22@@ -32,7 +32,7 @@ log = logging.getLogger("anaconda.main")
22 23
23 _is_url = lambda location: '://' in location # RFC 3986 24 is_url = lambda location: '://' in location # RFC 3986
24 25
25-SSL_VERIFY = True 26-SSL_VERIFY = True
26+SSL_VERIFY = False 27+SSL_VERIFY = False
@@ -28,10 +29,10 @@ index c6f013f..7adb751 100644
28 def load_to_str(location, user=None, passwd=None): 29 def load_to_str(location, user=None, passwd=None):
29 '''Load a destination URL or file into a string. 30 '''Load a destination URL or file into a string.
30diff --git a/pykickstart/parser.py b/pykickstart/parser.py 31diff --git a/pykickstart/parser.py b/pykickstart/parser.py
31index e44099b..e68174d 100644 32index b95ba90..a55a9a3 100644
32--- a/pykickstart/parser.py 33--- a/pykickstart/parser.py
33+++ b/pykickstart/parser.py 34+++ b/pykickstart/parser.py
34@@ -55,6 +55,20 @@ from pykickstart.i18n import _ 35@@ -51,6 +51,20 @@ from pykickstart.i18n import _
35 STATE_END = "end" 36 STATE_END = "end"
36 STATE_COMMANDS = "commands" 37 STATE_COMMANDS = "commands"
37 38
@@ -52,7 +53,7 @@ index e44099b..e68174d 100644
52 def _preprocessStateMachine(lineIter): 53 def _preprocessStateMachine(lineIter):
53 l = None 54 l = None
54 lineno = 0 55 lineno = 0
55@@ -788,6 +802,10 @@ class KickstartParser(object): 56@@ -791,6 +805,10 @@ class KickstartParser(object):
56 self._stateMachine(i) 57 self._stateMachine(i)
57 58
58 def readKickstart(self, f, reset=True, username=None, password=None): 59 def readKickstart(self, f, reset=True, username=None, password=None):
@@ -64,5 +65,5 @@ index e44099b..e68174d 100644
64 if reset: 65 if reset:
65 self._reset() 66 self._reset()
66-- 67--
672.7.4 682.34.1
68 69
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
diff --git a/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.34.bb b/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.43.bb
index 6bf9ada581..6f2edf2246 100644
--- a/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.34.bb
+++ b/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.43.bb
@@ -18,7 +18,7 @@ SRC_URI = "git://github.com/rhinstaller/pykickstart.git;protocol=https;branch=ma
18 file://0003-comment-out-sections-shutdown-and-environment-in-gen.patch \ 18 file://0003-comment-out-sections-shutdown-and-environment-in-gen.patch \
19 file://0004-load.py-retry-to-invoke-request-with-timeout.patch \ 19 file://0004-load.py-retry-to-invoke-request-with-timeout.patch \
20 " 20 "
21SRCREV = "bfd836cfdd8439d984595aca015811ed5c6be733" 21SRCREV = "6d488a0120f4da40aa0b04e29f37d7bb3297247f"
22 22
23UPSTREAM_CHECK_GITTAGREGEX = "r(?P<pver>\d+(\.\d+)+(-\d+)*)" 23UPSTREAM_CHECK_GITTAGREGEX = "r(?P<pver>\d+(\.\d+)+(-\d+)*)"
24 24