diff options
Diffstat (limited to 'meta-python/recipes-extended/python-pykickstart')
6 files changed, 77 insertions, 51 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/run-ptest b/meta-python/recipes-extended/python-pykickstart/files/run-ptest new file mode 100755 index 0000000000..289e68b054 --- /dev/null +++ b/meta-python/recipes-extended/python-pykickstart/files/run-ptest | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | pytest --automake --deselect tests/test_packages.py::AddGroupsAndEnvironment_TestCase --deselect tests/commands/test_reboot.py::Reboot_TestCase | ||
diff --git a/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.48.bb b/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.48.bb deleted file mode 100644 index 953068f7c3..0000000000 --- a/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.48.bb +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | DESCRIPTION = "A python library for manipulating kickstart files" | ||
2 | HOMEPAGE = "http://fedoraproject.org/wiki/pykickstart" | ||
3 | LICENSE = "GPL-2.0-or-later" | ||
4 | |||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" | ||
7 | |||
8 | DEPENDS = "python3" | ||
9 | RDEPENDS:${PN} = "python3 \ | ||
10 | python3-requests \ | ||
11 | python3-six \ | ||
12 | " | ||
13 | |||
14 | S = "${WORKDIR}/git" | ||
15 | SRC_URI = "git://github.com/rhinstaller/pykickstart.git;protocol=https;branch=master \ | ||
16 | file://0001-support-authentication-for-kickstart.patch \ | ||
17 | file://0002-pykickstart-parser.py-add-lock-for-readKickstart-and.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 \ | ||
20 | " | ||
21 | SRCREV = "fa6c80c0e5c6bee29d089899a10d26e6f7f8afd8" | ||
22 | |||
23 | UPSTREAM_CHECK_GITTAGREGEX = "r(?P<pver>\d+(\.\d+)+(-\d+)*)" | ||
24 | |||
25 | inherit setuptools3 | ||
diff --git a/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.63.bb b/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.63.bb new file mode 100644 index 0000000000..830e46a63c --- /dev/null +++ b/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.63.bb | |||
@@ -0,0 +1,39 @@ | |||
1 | DESCRIPTION = "A python library for manipulating kickstart files" | ||
2 | HOMEPAGE = "https://fedoraproject.org/wiki/pykickstart" | ||
3 | LICENSE = "GPL-2.0-or-later" | ||
4 | |||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=81bcece21748c91ba9992349a91ec11d" | ||
6 | |||
7 | inherit python_setuptools_build_meta ptest | ||
8 | |||
9 | RDEPENDS:${PN} = "python3 \ | ||
10 | python3-requests \ | ||
11 | python3-six \ | ||
12 | " | ||
13 | |||
14 | RDEPENDS:${PN}-ptest += " \ | ||
15 | python3-pytest \ | ||
16 | python3-unittest-automake-output \ | ||
17 | " | ||
18 | |||
19 | do_install_ptest() { | ||
20 | install -d ${D}${PTEST_PATH}/tests | ||
21 | cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests | ||
22 | for file in `grep -Rl unittest.main ${D}${PTEST_PATH}/tests/`; do | ||
23 | dirname=`dirname $file` | ||
24 | basename=`basename $file` | ||
25 | [ $basename != "__init__.py" ] && mv $file ${dirname}/test_${basename} | ||
26 | done | ||
27 | } | ||
28 | |||
29 | SRC_URI = "git://github.com/rhinstaller/pykickstart.git;protocol=https;branch=master;tag=r${PV} \ | ||
30 | file://0001-support-authentication-for-kickstart.patch \ | ||
31 | file://0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch \ | ||
32 | file://0003-comment-out-sections-shutdown-and-environment-in-gen.patch \ | ||
33 | file://0004-load.py-retry-to-invoke-request-with-timeout.patch \ | ||
34 | file://run-ptest \ | ||
35 | " | ||
36 | SRCREV = "6e0d1238cb4696a9040072a5a28a706e5775c552" | ||
37 | |||
38 | UPSTREAM_CHECK_GITTAGREGEX = "r(?P<pver>\d+(\.\d+)+(-\d+)*)" | ||
39 | |||