diff options
Diffstat (limited to 'meta-python')
-rw-r--r-- | meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch | 27 | ||||
-rw-r--r-- | meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch | 19 | ||||
-rw-r--r-- | meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.34.bb (renamed from meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.32.bb) | 2 |
3 files changed, 21 insertions, 27 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 0e64ce420e..5f95d74bf1 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,7 +1,7 @@ | |||
1 | From f05f5fc363e2510f6943532f3e14a6423f6a2cf1 Mon Sep 17 00:00:00 2001 | 1 | From 3540ddcc7448dc784b65c74424c8a25132cb8534 Mon Sep 17 00:00:00 2001 |
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
3 | Date: Tue, 31 Jul 2018 17:24:47 +0800 | 3 | Date: Tue, 31 Jul 2018 17:24:47 +0800 |
4 | Subject: [PATCH 1/4] support authentication for kickstart | 4 | Subject: [PATCH] support authentication for kickstart |
5 | 5 | ||
6 | While download kickstart file from web server, | 6 | While download kickstart file from web server, |
7 | we support basic/digest authentication. | 7 | we support basic/digest authentication. |
@@ -12,6 +12,7 @@ which the invoker could parse this specific error. | |||
12 | Upstream-Status: inappropriate [oe specific] | 12 | Upstream-Status: inappropriate [oe specific] |
13 | 13 | ||
14 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | 14 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
15 | |||
15 | --- | 16 | --- |
16 | pykickstart/errors.py | 17 +++++++++++++++++ | 17 | pykickstart/errors.py | 17 +++++++++++++++++ |
17 | pykickstart/load.py | 34 ++++++++++++++++++++++++++++------ | 18 | pykickstart/load.py | 34 ++++++++++++++++++++++++++++------ |
@@ -19,7 +20,7 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | |||
19 | 3 files changed, 47 insertions(+), 8 deletions(-) | 20 | 3 files changed, 47 insertions(+), 8 deletions(-) |
20 | 21 | ||
21 | diff --git a/pykickstart/errors.py b/pykickstart/errors.py | 22 | diff --git a/pykickstart/errors.py b/pykickstart/errors.py |
22 | index bf08ac5..aada7aa 100644 | 23 | index 8294f59a..3d20bf82 100644 |
23 | --- a/pykickstart/errors.py | 24 | --- a/pykickstart/errors.py |
24 | +++ b/pykickstart/errors.py | 25 | +++ b/pykickstart/errors.py |
25 | @@ -32,6 +32,9 @@ This module exports several exception classes: | 26 | @@ -32,6 +32,9 @@ This module exports several exception classes: |
@@ -51,10 +52,10 @@ index bf08ac5..aada7aa 100644 | |||
51 | + def __str__(self): | 52 | + def __str__(self): |
52 | + return self.value | 53 | + return self.value |
53 | diff --git a/pykickstart/load.py b/pykickstart/load.py | 54 | diff --git a/pykickstart/load.py b/pykickstart/load.py |
54 | index fb935f2..41a2e9e 100644 | 55 | index 30e2fcfa..b984876d 100644 |
55 | --- a/pykickstart/load.py | 56 | --- a/pykickstart/load.py |
56 | +++ b/pykickstart/load.py | 57 | +++ b/pykickstart/load.py |
57 | @@ -18,10 +18,13 @@ | 58 | @@ -18,9 +18,12 @@ |
58 | # with the express permission of Red Hat, Inc. | 59 | # with the express permission of Red Hat, Inc. |
59 | # | 60 | # |
60 | import requests | 61 | import requests |
@@ -62,14 +63,13 @@ index fb935f2..41a2e9e 100644 | |||
62 | +from requests.auth import HTTPBasicAuth | 63 | +from requests.auth import HTTPBasicAuth |
63 | + | 64 | + |
64 | import shutil | 65 | import shutil |
65 | import six | ||
66 | 66 | ||
67 | -from pykickstart.errors import KickstartError | 67 | -from pykickstart.errors import KickstartError |
68 | +from pykickstart.errors import KickstartError, KickstartAuthError | 68 | +from pykickstart.errors import KickstartError, KickstartAuthError |
69 | from pykickstart.i18n import _ | 69 | from pykickstart.i18n import _ |
70 | from requests.exceptions import SSLError, RequestException | 70 | from requests.exceptions import SSLError, RequestException |
71 | 71 | ||
72 | @@ -29,7 +32,7 @@ _is_url = lambda location: '://' in location # RFC 3986 | 72 | @@ -28,7 +31,7 @@ _is_url = lambda location: '://' in location # RFC 3986 |
73 | 73 | ||
74 | SSL_VERIFY = True | 74 | SSL_VERIFY = True |
75 | 75 | ||
@@ -78,7 +78,7 @@ index fb935f2..41a2e9e 100644 | |||
78 | '''Load a destination URL or file into a string. | 78 | '''Load a destination URL or file into a string. |
79 | Type of input is inferred automatically. | 79 | Type of input is inferred automatically. |
80 | 80 | ||
81 | @@ -40,7 +43,7 @@ def load_to_str(location): | 81 | @@ -39,7 +42,7 @@ def load_to_str(location): |
82 | Raises: KickstartError on error reading''' | 82 | Raises: KickstartError on error reading''' |
83 | 83 | ||
84 | if _is_url(location): | 84 | if _is_url(location): |
@@ -87,7 +87,7 @@ index fb935f2..41a2e9e 100644 | |||
87 | else: | 87 | else: |
88 | return _load_file(location) | 88 | return _load_file(location) |
89 | 89 | ||
90 | @@ -70,11 +73,30 @@ def load_to_file(location, destination): | 90 | @@ -69,11 +72,30 @@ def load_to_file(location, destination): |
91 | _copy_file(location, destination) | 91 | _copy_file(location, destination) |
92 | return destination | 92 | return destination |
93 | 93 | ||
@@ -122,10 +122,10 @@ index fb935f2..41a2e9e 100644 | |||
122 | raise KickstartError(_('Error securely accessing URL "%s"') % location + ': {e}'.format(e=str(e))) | 122 | raise KickstartError(_('Error securely accessing URL "%s"') % location + ': {e}'.format(e=str(e))) |
123 | except RequestException as e: | 123 | except RequestException as e: |
124 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py | 124 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py |
125 | index d8880eb..22d14cb 100644 | 125 | index b23e54f1..e10f06b5 100644 |
126 | --- a/pykickstart/parser.py | 126 | --- a/pykickstart/parser.py |
127 | +++ b/pykickstart/parser.py | 127 | +++ b/pykickstart/parser.py |
128 | @@ -801,7 +801,7 @@ class KickstartParser(object): | 128 | @@ -796,7 +796,7 @@ class KickstartParser(object): |
129 | i = PutBackIterator(s.splitlines(True) + [""]) | 129 | i = PutBackIterator(s.splitlines(True) + [""]) |
130 | self._stateMachine(i) | 130 | self._stateMachine(i) |
131 | 131 | ||
@@ -134,7 +134,7 @@ index d8880eb..22d14cb 100644 | |||
134 | """Process a kickstart file, given by the filename f.""" | 134 | """Process a kickstart file, given by the filename f.""" |
135 | if reset: | 135 | if reset: |
136 | self._reset() | 136 | self._reset() |
137 | @@ -822,7 +822,7 @@ class KickstartParser(object): | 137 | @@ -817,7 +817,7 @@ class KickstartParser(object): |
138 | self.currentdir[self._includeDepth] = cd | 138 | self.currentdir[self._includeDepth] = cd |
139 | 139 | ||
140 | try: | 140 | try: |
@@ -143,6 +143,3 @@ index d8880eb..22d14cb 100644 | |||
143 | except KickstartError as e: | 143 | except KickstartError as e: |
144 | raise KickstartError(_("Unable to open input kickstart file: %s") % str(e), lineno=0) | 144 | raise KickstartError(_("Unable to open input kickstart file: %s") % str(e), lineno=0) |
145 | 145 | ||
146 | -- | ||
147 | 2.7.4 | ||
148 | |||
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 6ed15ab09c..bf5a197230 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From ffe06c6dd812b604d6482e4353d5564fad78bc90 Mon Sep 17 00:00:00 2001 | 1 | From 737e9a7c11233183f48ce6c83d38b504c8ffed12 Mon Sep 17 00:00:00 2001 |
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
3 | Date: Mon, 30 Jul 2018 15:52:21 +0800 | 3 | Date: Mon, 30 Jul 2018 15:52:21 +0800 |
4 | Subject: [PATCH 4/4] load.py: retry to invoke request with timeout | 4 | Subject: [PATCH] load.py: retry to invoke request with timeout |
5 | 5 | ||
6 | While networkless, use request to fetch kickstart file from | 6 | While networkless, use request to fetch kickstart file from |
7 | network, it failed and wait 300s to break, we should retry | 7 | network, it failed and wait 300s to break, we should retry |
@@ -11,23 +11,23 @@ network is up, the fetch works. | |||
11 | Upstream-Status: inappropriate [oe specific] | 11 | Upstream-Status: inappropriate [oe specific] |
12 | 12 | ||
13 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | 13 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
14 | |||
14 | --- | 15 | --- |
15 | pykickstart/load.py | 31 +++++++++++++++++++++++++++++++ | 16 | pykickstart/load.py | 31 +++++++++++++++++++++++++++++++ |
16 | 1 file changed, 31 insertions(+) | 17 | 1 file changed, 31 insertions(+) |
17 | 18 | ||
18 | diff --git a/pykickstart/load.py b/pykickstart/load.py | 19 | diff --git a/pykickstart/load.py b/pykickstart/load.py |
19 | index ad3bad1..a5cbbc5 100644 | 20 | index f75fe5d3..a8f3ed1d 100644 |
20 | --- a/pykickstart/load.py | 21 | --- a/pykickstart/load.py |
21 | +++ b/pykickstart/load.py | 22 | +++ b/pykickstart/load.py |
22 | @@ -21,6 +21,7 @@ import requests | 23 | @@ -21,12 +21,16 @@ import requests |
23 | from requests.auth import HTTPDigestAuth | 24 | from requests.auth import HTTPDigestAuth |
24 | from requests.auth import HTTPBasicAuth | 25 | from requests.auth import HTTPBasicAuth |
25 | 26 | ||
26 | +import time | 27 | +import time |
27 | import shutil | 28 | import shutil |
28 | import six | ||
29 | 29 | ||
30 | @@ -28,6 +29,9 @@ from pykickstart.errors import KickstartError, KickstartAuthError | 30 | from pykickstart.errors import KickstartError, KickstartAuthError |
31 | from pykickstart.i18n import _ | 31 | from pykickstart.i18n import _ |
32 | from requests.exceptions import SSLError, RequestException | 32 | from requests.exceptions import SSLError, RequestException |
33 | 33 | ||
@@ -37,7 +37,7 @@ index ad3bad1..a5cbbc5 100644 | |||
37 | _is_url = lambda location: '://' in location # RFC 3986 | 37 | _is_url = lambda location: '://' in location # RFC 3986 |
38 | 38 | ||
39 | SSL_VERIFY = False | 39 | SSL_VERIFY = False |
40 | @@ -73,6 +77,29 @@ def load_to_file(location, destination): | 40 | @@ -72,6 +76,29 @@ def load_to_file(location, destination): |
41 | _copy_file(location, destination) | 41 | _copy_file(location, destination) |
42 | return destination | 42 | return destination |
43 | 43 | ||
@@ -67,7 +67,7 @@ index ad3bad1..a5cbbc5 100644 | |||
67 | def _get_auth(location, user=None, passwd=None): | 67 | def _get_auth(location, user=None, passwd=None): |
68 | 68 | ||
69 | auth = None | 69 | auth = None |
70 | @@ -94,6 +121,10 @@ def _get_auth(location, user=None, passwd=None): | 70 | @@ -93,6 +120,10 @@ def _get_auth(location, user=None, passwd=None): |
71 | 71 | ||
72 | def _load_url(location, user=None, passwd=None): | 72 | def _load_url(location, user=None, passwd=None): |
73 | '''Load a location (URL or filename) and return contents as string''' | 73 | '''Load a location (URL or filename) and return contents as string''' |
@@ -78,6 +78,3 @@ index ad3bad1..a5cbbc5 100644 | |||
78 | auth = _get_auth(location, user=user, passwd=passwd) | 78 | auth = _get_auth(location, user=user, passwd=passwd) |
79 | try: | 79 | try: |
80 | request = requests.get(location, verify=SSL_VERIFY, auth=auth) | 80 | request = requests.get(location, verify=SSL_VERIFY, auth=auth) |
81 | -- | ||
82 | 2.7.4 | ||
83 | |||
diff --git a/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.32.bb b/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.34.bb index 829ada4f8b..65fc88e77b 100644 --- a/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.32.bb +++ b/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.34.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 | " |
21 | SRCREV = "c56a5fbdd4079b187b21787f072ccc83dc09c28c" | 21 | SRCREV = "bfd836cfdd8439d984595aca015811ed5c6be733" |
22 | 22 | ||
23 | UPSTREAM_CHECK_GITTAGREGEX = "r(?P<pver>\d+(\.\d+)+(-\d+)*)" | 23 | UPSTREAM_CHECK_GITTAGREGEX = "r(?P<pver>\d+(\.\d+)+(-\d+)*)" |
24 | 24 | ||