diff options
-rw-r--r-- | meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch | 26 | ||||
-rw-r--r-- | meta-python/recipes-extended/python-pykickstart/files/0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch | 19 | ||||
-rw-r--r-- | meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch | 16 | ||||
-rw-r--r-- | meta-python/recipes-extended/python-pykickstart/files/0005-options-adjust-to-behavior-change-in-upstream-_parse.patch | 71 | ||||
-rw-r--r-- | meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.62.bb (renamed from meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.48.bb) | 5 |
5 files changed, 37 insertions, 100 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 @@ | |||
1 | From 3540ddcc7448dc784b65c74424c8a25132cb8534 Mon Sep 17 00:00:00 2001 | 1 | From 80190be8d9c82ed816fb571abef416a1fbfb9a35 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] support authentication for kickstart | 4 | Subject: [PATCH] support authentication for kickstart |
@@ -12,11 +12,14 @@ 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 | |||
16 | Rebase to 3.62 | ||
17 | Signed-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 | ||
21 | diff --git a/pykickstart/errors.py b/pykickstart/errors.py | 24 | diff --git a/pykickstart/errors.py b/pykickstart/errors.py |
22 | index 8294f59..3d20bf8 100644 | 25 | index 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 |
53 | diff --git a/pykickstart/load.py b/pykickstart/load.py | 56 | diff --git a/pykickstart/load.py b/pykickstart/load.py |
54 | index eb76b65..f51cf08 100644 | 57 | index 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: |
122 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py | 126 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py |
123 | index 7edf8aa..46c5299 100644 | 127 | index 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: |
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 f5483db825..cf5dd95d48 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,8 +1,8 @@ | |||
1 | From 62fdead139edb0f29b2f222efcb8f39be15b057e Mon Sep 17 00:00:00 2001 | 1 | From 42076483ed38d50400156cbb75d4c9b0180e6957 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:47:13 +0800 | 3 | Date: Mon, 30 Jul 2018 15:47:13 +0800 |
4 | Subject: [PATCH 2/4] pykickstart/parser.py: add lock for readKickstart and | 4 | Subject: [PATCH] pykickstart/parser.py: add lock for readKickstart and support |
5 | support https without certification | 5 | https without certification |
6 | 6 | ||
7 | - Add lock for readKickstart to fix race issue | 7 | - Add lock for readKickstart to fix race issue |
8 | 8 | ||
@@ -13,15 +13,18 @@ Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> | |||
13 | --- | 13 | --- |
14 | Upstream-Status: Pending | 14 | Upstream-Status: Pending |
15 | 15 | ||
16 | Rebase to 3.62 | ||
17 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
18 | --- | ||
16 | pykickstart/load.py | 2 +- | 19 | pykickstart/load.py | 2 +- |
17 | pykickstart/parser.py | 18 ++++++++++++++++++ | 20 | pykickstart/parser.py | 18 ++++++++++++++++++ |
18 | 2 files changed, 19 insertions(+), 1 deletion(-) | 21 | 2 files changed, 19 insertions(+), 1 deletion(-) |
19 | 22 | ||
20 | diff --git a/pykickstart/load.py b/pykickstart/load.py | 23 | diff --git a/pykickstart/load.py b/pykickstart/load.py |
21 | index 8da8051..e856c8d 100644 | 24 | index 45d402a..6eeffde 100644 |
22 | --- a/pykickstart/load.py | 25 | --- a/pykickstart/load.py |
23 | +++ b/pykickstart/load.py | 26 | +++ b/pykickstart/load.py |
24 | @@ -32,7 +32,7 @@ log = logging.getLogger("anaconda.main") | 27 | @@ -28,7 +28,7 @@ from requests.exceptions import SSLError, RequestException |
25 | 28 | ||
26 | is_url = lambda location: '://' in location # RFC 3986 | 29 | is_url = lambda location: '://' in location # RFC 3986 |
27 | 30 | ||
@@ -31,10 +34,10 @@ index 8da8051..e856c8d 100644 | |||
31 | def load_to_str(location, user=None, passwd=None): | 34 | def load_to_str(location, user=None, passwd=None): |
32 | '''Load a destination URL or file into a string. | 35 | '''Load a destination URL or file into a string. |
33 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py | 36 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py |
34 | index b95ba90..a55a9a3 100644 | 37 | index 351dc1b..aef59ca 100644 |
35 | --- a/pykickstart/parser.py | 38 | --- a/pykickstart/parser.py |
36 | +++ b/pykickstart/parser.py | 39 | +++ b/pykickstart/parser.py |
37 | @@ -51,6 +51,20 @@ from pykickstart.i18n import _ | 40 | @@ -54,6 +54,20 @@ from pykickstart.i18n import _ |
38 | STATE_END = "end" | 41 | STATE_END = "end" |
39 | STATE_COMMANDS = "commands" | 42 | STATE_COMMANDS = "commands" |
40 | 43 | ||
@@ -55,7 +58,7 @@ index b95ba90..a55a9a3 100644 | |||
55 | def _preprocessStateMachine(lineIter): | 58 | def _preprocessStateMachine(lineIter): |
56 | l = None | 59 | l = None |
57 | lineno = 0 | 60 | lineno = 0 |
58 | @@ -791,6 +805,10 @@ class KickstartParser(object): | 61 | @@ -832,6 +846,10 @@ class KickstartParser(object): |
59 | self._stateMachine(i) | 62 | self._stateMachine(i) |
60 | 63 | ||
61 | def readKickstart(self, f, reset=True, username=None, password=None): | 64 | def readKickstart(self, f, reset=True, username=None, password=None): |
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 abe2c87e00..e2c65ee957 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,4 +1,4 @@ | |||
1 | From 737e9a7c11233183f48ce6c83d38b504c8ffed12 Mon Sep 17 00:00:00 2001 | 1 | From d5e6304dff890b39a53a96f03819aa118deb701a 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] load.py: retry to invoke request with timeout | 4 | Subject: [PATCH] load.py: retry to invoke request with timeout |
@@ -11,12 +11,15 @@ 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 | |||
15 | Rebase to 3.62 | ||
16 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
14 | --- | 17 | --- |
15 | pykickstart/load.py | 31 +++++++++++++++++++++++++++++++ | 18 | pykickstart/load.py | 30 ++++++++++++++++++++++++++++++ |
16 | 1 file changed, 31 insertions(+) | 19 | 1 file changed, 30 insertions(+) |
17 | 20 | ||
18 | diff --git a/pykickstart/load.py b/pykickstart/load.py | 21 | diff --git a/pykickstart/load.py b/pykickstart/load.py |
19 | index 58faba6..e856c8d 100644 | 22 | index 6eeffde..da0032f 100644 |
20 | --- a/pykickstart/load.py | 23 | --- a/pykickstart/load.py |
21 | +++ b/pykickstart/load.py | 24 | +++ b/pykickstart/load.py |
22 | @@ -20,12 +20,16 @@ | 25 | @@ -20,12 +20,16 @@ |
@@ -66,11 +69,10 @@ index 58faba6..e856c8d 100644 | |||
66 | def _get_auth(location, user=None, passwd=None): | 69 | def _get_auth(location, user=None, passwd=None): |
67 | 70 | ||
68 | auth = None | 71 | auth = None |
69 | @@ -92,6 +119,10 @@ def _get_auth(location, user=None, passwd=None): | 72 | @@ -93,6 +120,9 @@ def _get_auth(location, user=None, passwd=None): |
70 | |||
71 | def _load_url(location, user=None, passwd=None): | 73 | def _load_url(location, user=None, passwd=None): |
72 | '''Load a location (URL or filename) and return contents as string''' | 74 | '''Load a location (URL or filename) and return contents as string''' |
73 | + | 75 | |
74 | + if not _access_url(location): | 76 | + if not _access_url(location): |
75 | + raise KickstartError(_("Connection %s failed" % location)) | 77 | + raise KickstartError(_("Connection %s failed" % location)) |
76 | + | 78 | + |
diff --git a/meta-python/recipes-extended/python-pykickstart/files/0005-options-adjust-to-behavior-change-in-upstream-_parse.patch b/meta-python/recipes-extended/python-pykickstart/files/0005-options-adjust-to-behavior-change-in-upstream-_parse.patch deleted file mode 100644 index e2b34ab937..0000000000 --- a/meta-python/recipes-extended/python-pykickstart/files/0005-options-adjust-to-behavior-change-in-upstream-_parse.patch +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | From f753d4d6ad1f4846d14735beb3d1b157b9914b51 Mon Sep 17 00:00:00 2001 | ||
2 | From: Adam Williamson <awilliam@redhat.com> | ||
3 | Date: Wed, 2 Oct 2024 09:48:39 -0700 | ||
4 | Subject: [PATCH] options: adjust to behavior change in upstream | ||
5 | _parse_optional | ||
6 | |||
7 | In Python 3.13 and 3.12.7, the behavior of _parse_optional has | ||
8 | changed. It used to raise an error on multiple matching actions | ||
9 | itself, and only ever return None or an option tuple. Now the | ||
10 | "raise error on multiple matching actions" code was moved out | ||
11 | into consume_optional, and _parse_optional returns either None | ||
12 | or a *list* of option tuples, which contains more than one if | ||
13 | multiple actions match. See: | ||
14 | |||
15 | https://github.com/python/cpython/pull/124631 | ||
16 | https://github.com/python/cpython/issues/58573 | ||
17 | |||
18 | This adapts to the change in a way that should work on both older | ||
19 | and newer Pythons. | ||
20 | |||
21 | Signed-off-by: Adam Williamson <awilliam@redhat.com> | ||
22 | |||
23 | Upstream-Status: Backport [https://github.com/pykickstart/pykickstart/commit/f753d4d] | ||
24 | |||
25 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
26 | --- | ||
27 | pykickstart/options.py | 20 +++++++++++++++++--- | ||
28 | 1 file changed, 17 insertions(+), 3 deletions(-) | ||
29 | |||
30 | diff --git a/pykickstart/options.py b/pykickstart/options.py | ||
31 | index 2e3a0721..ca0e18af 100644 | ||
32 | --- a/pykickstart/options.py | ||
33 | +++ b/pykickstart/options.py | ||
34 | @@ -177,9 +177,23 @@ class KSOptionParser(ArgumentParser): | ||
35 | self.lineno = None | ||
36 | |||
37 | def _parse_optional(self, arg_string): | ||
38 | - option_tuple = ArgumentParser._parse_optional(self, arg_string) | ||
39 | + # Before 3.13 and 3.12.7, this returned None or a single | ||
40 | + # option tuple. From 3.13 / 3.12.7 onwards it returns None | ||
41 | + # or a *list* of option tuples | ||
42 | + option_tuple_or_tuples = ArgumentParser._parse_optional(self, arg_string) | ||
43 | + # all we want to do here is a custom warning if the action is | ||
44 | + # deprecated. we can only safely do this if there's exactly | ||
45 | + # one matching action | ||
46 | + if isinstance(option_tuple_or_tuples, list): | ||
47 | + if len(option_tuple_or_tuples) == 1: | ||
48 | + option_tuple = option_tuple_or_tuples[0] | ||
49 | + else: | ||
50 | + return option_tuple_or_tuples | ||
51 | + else: | ||
52 | + option_tuple = option_tuple_or_tuples | ||
53 | + | ||
54 | if option_tuple is None or option_tuple[0] is None: | ||
55 | - return option_tuple | ||
56 | + return option_tuple_or_tuples | ||
57 | |||
58 | action = option_tuple[0] | ||
59 | option = action.option_strings[0] | ||
60 | @@ -191,7 +205,7 @@ class KSOptionParser(ArgumentParser): | ||
61 | "kickstart. Please modify your kickstart file to remove this option.") | ||
62 | % {"lineno": self.lineno, "option": option}, KickstartDeprecationWarning) | ||
63 | |||
64 | - return option_tuple | ||
65 | + return option_tuple_or_tuples | ||
66 | |||
67 | def add_argument(self, *args, **kwargs): | ||
68 | if "introduced" in kwargs: | ||
69 | -- | ||
70 | 2.47.1 | ||
71 | |||
diff --git a/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.48.bb b/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.62.bb index df66a8ebf7..9b15f957de 100644 --- a/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.48.bb +++ b/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.62.bb | |||
@@ -2,7 +2,7 @@ DESCRIPTION = "A python library for manipulating kickstart files" | |||
2 | HOMEPAGE = "https://fedoraproject.org/wiki/pykickstart" | 2 | HOMEPAGE = "https://fedoraproject.org/wiki/pykickstart" |
3 | LICENSE = "GPL-2.0-or-later" | 3 | LICENSE = "GPL-2.0-or-later" |
4 | 4 | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=81bcece21748c91ba9992349a91ec11d" |
6 | 6 | ||
7 | inherit python_setuptools_build_meta | 7 | inherit python_setuptools_build_meta |
8 | 8 | ||
@@ -16,9 +16,8 @@ SRC_URI = "git://github.com/rhinstaller/pykickstart.git;protocol=https;branch=ma | |||
16 | file://0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch \ | 16 | file://0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch \ |
17 | file://0003-comment-out-sections-shutdown-and-environment-in-gen.patch \ | 17 | file://0003-comment-out-sections-shutdown-and-environment-in-gen.patch \ |
18 | file://0004-load.py-retry-to-invoke-request-with-timeout.patch \ | 18 | file://0004-load.py-retry-to-invoke-request-with-timeout.patch \ |
19 | file://0005-options-adjust-to-behavior-change-in-upstream-_parse.patch \ | ||
20 | " | 19 | " |
21 | SRCREV = "fa6c80c0e5c6bee29d089899a10d26e6f7f8afd8" | 20 | SRCREV = "27f1bd96d1be83da5bea0159f785753ae393ee2d" |
22 | 21 | ||
23 | UPSTREAM_CHECK_GITTAGREGEX = "r(?P<pver>\d+(\.\d+)+(-\d+)*)" | 22 | UPSTREAM_CHECK_GITTAGREGEX = "r(?P<pver>\d+(\.\d+)+(-\d+)*)" |
24 | 23 | ||