summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch')
-rw-r--r--meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch26
1 files changed, 15 insertions, 11 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 309a00122a..ed656f6c6a 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
@@ -1,4 +1,4 @@
1From 3540ddcc7448dc784b65c74424c8a25132cb8534 Mon Sep 17 00:00:00 2001 1From 80190be8d9c82ed816fb571abef416a1fbfb9a35 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Tue, 31 Jul 2018 17:24:47 +0800 3Date: Tue, 31 Jul 2018 17:24:47 +0800
4Subject: [PATCH] support authentication for kickstart 4Subject: [PATCH] support authentication for kickstart
@@ -12,11 +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
16Rebase to 3.62
17Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
15--- 18---
16 pykickstart/errors.py | 17 +++++++++++++++++ 19 pykickstart/errors.py | 17 +++++++++++++++++
17 pykickstart/load.py | 32 +++++++++++++++++++++++++++----- 20 pykickstart/load.py | 33 ++++++++++++++++++++++++++++-----
18 pykickstart/parser.py | 4 ++-- 21 pykickstart/parser.py | 4 ++--
19 3 files changed, 46 insertions(+), 7 deletions(-) 22 3 files changed, 47 insertions(+), 7 deletions(-)
20 23
21diff --git a/pykickstart/errors.py b/pykickstart/errors.py 24diff --git a/pykickstart/errors.py b/pykickstart/errors.py
22index 8294f59..3d20bf8 100644 25index 8294f59..3d20bf8 100644
@@ -51,7 +54,7 @@ index 8294f59..3d20bf8 100644
51+ def __str__(self): 54+ def __str__(self):
52+ return self.value 55+ return self.value
53diff --git a/pykickstart/load.py b/pykickstart/load.py 56diff --git a/pykickstart/load.py b/pykickstart/load.py
54index eb76b65..f51cf08 100644 57index e8301a4..45d402a 100644
55--- a/pykickstart/load.py 58--- a/pykickstart/load.py
56+++ b/pykickstart/load.py 59+++ b/pykickstart/load.py
57@@ -18,9 +18,11 @@ 60@@ -18,9 +18,11 @@
@@ -85,7 +88,7 @@ index eb76b65..f51cf08 100644
85 else: 88 else:
86 return _load_file(location) 89 return _load_file(location)
87 90
88@@ -69,11 +71,31 @@ def load_to_file(location, destination): 91@@ -69,11 +71,32 @@ def load_to_file(location, destination):
89 _copy_file(location, destination) 92 _copy_file(location, destination)
90 return destination 93 return destination
91 94
@@ -111,19 +114,20 @@ index eb76b65..f51cf08 100644
111+ 114+
112+def _load_url(location, user=None, passwd=None): 115+def _load_url(location, user=None, passwd=None):
113 '''Load a location (URL or filename) and return contents as string''' 116 '''Load a location (URL or filename) and return contents as string'''
114+ auth = _get_auth(location, user=user, passwd=passwd)
115 117
118+ auth = _get_auth(location, user=user, passwd=passwd)
119+
116 try: 120 try:
117- request = requests.get(location, verify=SSL_VERIFY) 121- request = requests.get(location, verify=SSL_VERIFY, timeout=120)
118+ request = requests.get(location, verify=SSL_VERIFY, auth=auth) 122+ request = requests.get(location, verify=SSL_VERIFY, auth=auth, timeout=120)
119 except SSLError as e: 123 except SSLError as e:
120 raise KickstartError(_('Error securely accessing URL "%s"') % location + ': {e}'.format(e=str(e))) 124 raise KickstartError(_('Error securely accessing URL "%s"') % location + ': {e}'.format(e=str(e)))
121 except RequestException as e: 125 except RequestException as e:
122diff --git a/pykickstart/parser.py b/pykickstart/parser.py 126diff --git a/pykickstart/parser.py b/pykickstart/parser.py
123index 7edf8aa..46c5299 100644 127index 12b0467..351dc1b 100644
124--- a/pykickstart/parser.py 128--- a/pykickstart/parser.py
125+++ b/pykickstart/parser.py 129+++ b/pykickstart/parser.py
126@@ -790,7 +790,7 @@ class KickstartParser(object): 130@@ -831,7 +831,7 @@ class KickstartParser(object):
127 i = PutBackIterator(s.splitlines(True) + [""]) 131 i = PutBackIterator(s.splitlines(True) + [""])
128 self._stateMachine(i) 132 self._stateMachine(i)
129 133
@@ -132,7 +136,7 @@ index 7edf8aa..46c5299 100644
132 """Process a kickstart file, given by the filename f.""" 136 """Process a kickstart file, given by the filename f."""
133 if reset: 137 if reset:
134 self._reset() 138 self._reset()
135@@ -811,7 +811,7 @@ class KickstartParser(object): 139@@ -852,7 +852,7 @@ class KickstartParser(object):
136 self.currentdir[self._includeDepth] = cd 140 self.currentdir[self._includeDepth] = cd
137 141
138 try: 142 try: