diff options
| author | Hongxu Jia <hongxu.jia@windriver.com> | 2018-08-01 15:21:39 +0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2018-08-02 11:23:03 -0700 |
| commit | 4c61e30cfb965d260fc0cd5339a3a7c8e781eac2 (patch) | |
| tree | 0a6376d8b95c362088544d1b0aaf73ffd7bc0e22 /meta-python/recipes-extended/python-pykickstart | |
| parent | f38ff38f48468a4505ed6396e832d2574d7914d7 (diff) | |
| download | meta-openembedded-4c61e30cfb965d260fc0cd5339a3a7c8e781eac2.tar.gz | |
python3-pykickstart: 2.35 -> 3.15
- Rebase 0001 ~ 0004
- Drop 0005-tweak-shebang-to-python3.patch
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-extended/python-pykickstart')
| -rw-r--r-- | meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch | 59 | ||||
| -rw-r--r-- | meta-python/recipes-extended/python-pykickstart/files/0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch | 36 | ||||
| -rw-r--r-- | meta-python/recipes-extended/python-pykickstart/files/0003-comment-out-sections-shutdown-and-environment-in-gen.patch | 10 | ||||
| -rw-r--r-- | meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch | 25 | ||||
| -rw-r--r-- | meta-python/recipes-extended/python-pykickstart/files/0005-tweak-shebang-to-python3.patch | 25 | ||||
| -rw-r--r-- | meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.15.bb (renamed from meta-python/recipes-extended/python-pykickstart/python3-pykickstart_2.35.bb) | 5 |
6 files changed, 62 insertions, 98 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 617699db07..6af4bde08a 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,6 +1,6 @@ | |||
| 1 | From d0d8890b5ef74c315381c9e1cff4b1d32892116b Mon Sep 17 00:00:00 2001 | 1 | From b7070a79432b790dffa82401364e4fd8d906eb2b 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: Thu, 1 Jun 2017 15:07:36 +0800 | 3 | Date: Tue, 31 Jul 2018 17:24:47 +0800 |
| 4 | Subject: [PATCH 1/4] support authentication for kickstart | 4 | Subject: [PATCH 1/4] support authentication for kickstart |
| 5 | 5 | ||
| 6 | While download kickstart file from web server, | 6 | While download kickstart file from web server, |
| @@ -13,30 +13,29 @@ 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 | pykickstart/errors.py | 19 +++++++++++++++++++ | 16 | pykickstart/errors.py | 17 +++++++++++++++++ |
| 17 | pykickstart/load.py | 32 +++++++++++++++++++++++++++----- | 17 | pykickstart/load.py | 34 ++++++++++++++++++++++++++++------ |
| 18 | pykickstart/parser.py | 4 ++-- | 18 | pykickstart/parser.py | 4 ++-- |
| 19 | 3 files changed, 48 insertions(+), 7 deletions(-) | 19 | 3 files changed, 47 insertions(+), 8 deletions(-) |
| 20 | 20 | ||
| 21 | diff --git a/pykickstart/errors.py b/pykickstart/errors.py | 21 | diff --git a/pykickstart/errors.py b/pykickstart/errors.py |
| 22 | index b76e84c..fd81bc8 100644 | 22 | index bf08ac5..aada7aa 100644 |
| 23 | --- a/pykickstart/errors.py | 23 | --- a/pykickstart/errors.py |
| 24 | +++ b/pykickstart/errors.py | 24 | +++ b/pykickstart/errors.py |
| 25 | @@ -35,6 +35,10 @@ It also exports several exception classes: | 25 | @@ -32,6 +32,9 @@ This module exports several exception classes: |
| 26 | |||
| 27 | KickstartVersionError - An exception for errors relating to unsupported | 26 | KickstartVersionError - An exception for errors relating to unsupported |
| 28 | syntax versions. | 27 | syntax versions. |
| 29 | + | 28 | |
| 30 | + KickstartAuthError - An exception for errors relating to authentication | 29 | + KickstartAuthError - An exception for errors relating to authentication |
| 31 | + failed while downloading kickstart from web server | 30 | + failed while downloading kickstart from web server |
| 32 | + | 31 | + |
| 33 | """ | 32 | And some warning classes: |
| 34 | import warnings | ||
| 35 | |||
| 36 | @@ -103,3 +107,18 @@ class KickstartVersionError(KickstartError): | ||
| 37 | 33 | ||
| 38 | def __str__ (self): | 34 | KickstartWarning - A generic warning class. |
| 39 | return self.value | 35 | @@ -131,3 +134,17 @@ class KickstartDeprecationWarning(KickstartParseWarning, DeprecationWarning): |
| 36 | commands and options. | ||
| 37 | """ | ||
| 38 | pass | ||
| 40 | + | 39 | + |
| 41 | +class KickstartAuthError(KickstartError): | 40 | +class KickstartAuthError(KickstartError): |
| 42 | + """An exception for errors relating to authentication failed while | 41 | + """An exception for errors relating to authentication failed while |
| @@ -51,9 +50,8 @@ index b76e84c..fd81bc8 100644 | |||
| 51 | + | 50 | + |
| 52 | + def __str__(self): | 51 | + def __str__(self): |
| 53 | + return self.value | 52 | + return self.value |
| 54 | + | ||
| 55 | diff --git a/pykickstart/load.py b/pykickstart/load.py | 53 | diff --git a/pykickstart/load.py b/pykickstart/load.py |
| 56 | index 1f69b9c..0f5741b 100644 | 54 | index fb935f2..c6f013f 100644 |
| 57 | --- a/pykickstart/load.py | 55 | --- a/pykickstart/load.py |
| 58 | +++ b/pykickstart/load.py | 56 | +++ b/pykickstart/load.py |
| 59 | @@ -18,10 +18,13 @@ | 57 | @@ -18,10 +18,13 @@ |
| @@ -71,7 +69,7 @@ index 1f69b9c..0f5741b 100644 | |||
| 71 | from pykickstart.i18n import _ | 69 | from pykickstart.i18n import _ |
| 72 | from requests.exceptions import SSLError, RequestException | 70 | from requests.exceptions import SSLError, RequestException |
| 73 | 71 | ||
| 74 | @@ -29,7 +32,7 @@ _is_url = lambda location: '://' in location # RFC 3986 | 72 | @@ -29,7 +32,7 @@ _is_url = lambda location: '://' in location # RFC 3986 |
| 75 | 73 | ||
| 76 | SSL_VERIFY = True | 74 | SSL_VERIFY = True |
| 77 | 75 | ||
| @@ -89,10 +87,12 @@ index 1f69b9c..0f5741b 100644 | |||
| 89 | else: | 87 | else: |
| 90 | return _load_file(location) | 88 | return _load_file(location) |
| 91 | 89 | ||
| 92 | @@ -71,13 +74,32 @@ def load_to_file(location, destination): | 90 | @@ -70,11 +73,30 @@ def load_to_file(location, destination): |
| 93 | _copy_file(location, destination) | 91 | _copy_file(location, destination) |
| 94 | return destination | 92 | return destination |
| 95 | 93 | ||
| 94 | -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): | 96 | +def _get_auth(location, user=None, passwd=None): |
| 97 | + | 97 | + |
| 98 | + auth = None | 98 | + auth = None |
| @@ -101,7 +101,7 @@ index 1f69b9c..0f5741b 100644 | |||
| 101 | + if user is None or passwd is None: | 101 | + if user is None or passwd is None: |
| 102 | + log.info("Require Authentication") | 102 | + log.info("Require Authentication") |
| 103 | + raise KickstartAuthError("Require Authentication.\nAppend 'ksuser=<username> kspasswd=<password>' to boot command") | 103 | + raise KickstartAuthError("Require Authentication.\nAppend 'ksuser=<username> kspasswd=<password>' to boot command") |
| 104 | 104 | + | |
| 105 | + reasons = request.headers.get("WWW-Authenticate", "").split() | 105 | + reasons = request.headers.get("WWW-Authenticate", "").split() |
| 106 | + if reasons: | 106 | + if reasons: |
| 107 | + auth_type = reasons[0] | 107 | + auth_type = reasons[0] |
| @@ -109,15 +109,12 @@ index 1f69b9c..0f5741b 100644 | |||
| 109 | + auth = HTTPBasicAuth(user, passwd) | 109 | + auth = HTTPBasicAuth(user, passwd) |
| 110 | + elif auth_type == "Digest": | 110 | + elif auth_type == "Digest": |
| 111 | + auth=HTTPDigestAuth(user, passwd) | 111 | + auth=HTTPDigestAuth(user, passwd) |
| 112 | |||
| 113 | -def _load_url(location): | ||
| 114 | + return auth | ||
| 115 | + | 112 | + |
| 116 | +def _load_url(location, user=None, passwd=None): | 113 | + return auth |
| 117 | '''Load a location (URL or filename) and return contents as string''' | ||
| 118 | 114 | ||
| 115 | +def _load_url(location, user=None, passwd=None): | ||
| 116 | + '''Load a location (URL or filename) and return contents as string''' | ||
| 119 | + auth = _get_auth(location, user=user, passwd=passwd) | 117 | + auth = _get_auth(location, user=user, passwd=passwd) |
| 120 | + | ||
| 121 | try: | 118 | try: |
| 122 | - request = requests.get(location, verify=SSL_VERIFY) | 119 | - request = requests.get(location, verify=SSL_VERIFY) |
| 123 | + request = requests.get(location, verify=SSL_VERIFY, auth=auth) | 120 | + request = requests.get(location, verify=SSL_VERIFY, auth=auth) |
| @@ -125,26 +122,26 @@ index 1f69b9c..0f5741b 100644 | |||
| 125 | 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))) |
| 126 | except RequestException as e: | 123 | except RequestException as e: |
| 127 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py | 124 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py |
| 128 | index d2b0fbe..26b5de9 100644 | 125 | index d8880eb..22d14cb 100644 |
| 129 | --- a/pykickstart/parser.py | 126 | --- a/pykickstart/parser.py |
| 130 | +++ b/pykickstart/parser.py | 127 | +++ b/pykickstart/parser.py |
| 131 | @@ -773,7 +773,7 @@ class KickstartParser(object): | 128 | @@ -787,7 +787,7 @@ class KickstartParser(object): |
| 132 | i = PutBackIterator(s.splitlines(True) + [""]) | 129 | i = PutBackIterator(s.splitlines(True) + [""]) |
| 133 | self._stateMachine (i) | 130 | self._stateMachine(i) |
| 134 | 131 | ||
| 135 | - def readKickstart(self, f, reset=True): | 132 | - def readKickstart(self, f, reset=True): |
| 136 | + def readKickstart(self, f, reset=True, username=None, password=None): | 133 | + def readKickstart(self, f, reset=True, username=None, password=None): |
| 137 | """Process a kickstart file, given by the filename f.""" | 134 | """Process a kickstart file, given by the filename f.""" |
| 138 | if reset: | 135 | if reset: |
| 139 | self._reset() | 136 | self._reset() |
| 140 | @@ -794,7 +794,7 @@ class KickstartParser(object): | 137 | @@ -808,7 +808,7 @@ class KickstartParser(object): |
| 141 | self.currentdir[self._includeDepth] = cd | 138 | self.currentdir[self._includeDepth] = cd |
| 142 | 139 | ||
| 143 | try: | 140 | try: |
| 144 | - s = load_to_str(f) | 141 | - s = load_to_str(f) |
| 145 | + s = load_to_str(f, user=username, passwd=password) | 142 | + s = load_to_str(f, user=username, passwd=password) |
| 146 | except KickstartError as e: | 143 | except KickstartError as e: |
| 147 | raise KickstartError(formatErrorMsg(0, msg=_("Unable to open input kickstart file: %s") % str(e))) | 144 | raise KickstartError(_("Unable to open input kickstart file: %s") % str(e), lineno=0) |
| 148 | 145 | ||
| 149 | -- | 146 | -- |
| 150 | 2.7.4 | 147 | 2.7.4 |
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 cb21235460..4a001f3386 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,28 +1,26 @@ | |||
| 1 | From e6e747b883114bfad51ad93f823e65f5a4d6438a Mon Sep 17 00:00:00 2001 | 1 | From 62fdead139edb0f29b2f222efcb8f39be15b057e 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: Thu, 1 Jun 2017 15:12:29 +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 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 |
| 8 | 8 | ||
| 9 | - Support to download kickstart file through https without certification | 9 | - Support to download kickstart file through https without certification |
| 10 | 10 | ||
| 11 | Upstream-Status: Inappropriate[oe specific] | ||
| 12 | |||
| 13 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | 11 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 14 | --- | 12 | --- |
| 15 | pykickstart/load.py | 2 +- | 13 | pykickstart/load.py | 2 +- |
| 16 | pykickstart/parser.py | 24 ++++++++++++++++++++++++ | 14 | pykickstart/parser.py | 18 ++++++++++++++++++ |
| 17 | 2 files changed, 25 insertions(+), 1 deletion(-) | 15 | 2 files changed, 19 insertions(+), 1 deletion(-) |
| 18 | 16 | ||
| 19 | diff --git a/pykickstart/load.py b/pykickstart/load.py | 17 | diff --git a/pykickstart/load.py b/pykickstart/load.py |
| 20 | index 0f5741b..48c8276 100644 | 18 | index c6f013f..7adb751 100644 |
| 21 | --- a/pykickstart/load.py | 19 | --- a/pykickstart/load.py |
| 22 | +++ b/pykickstart/load.py | 20 | +++ b/pykickstart/load.py |
| 23 | @@ -30,7 +30,7 @@ from requests.exceptions import SSLError, RequestException | 21 | @@ -30,7 +30,7 @@ from requests.exceptions import SSLError, RequestException |
| 24 | 22 | ||
| 25 | _is_url = lambda location: '://' in location # RFC 3986 | 23 | _is_url = lambda location: '://' in location # RFC 3986 |
| 26 | 24 | ||
| 27 | -SSL_VERIFY = True | 25 | -SSL_VERIFY = True |
| 28 | +SSL_VERIFY = False | 26 | +SSL_VERIFY = False |
| @@ -30,38 +28,32 @@ index 0f5741b..48c8276 100644 | |||
| 30 | def load_to_str(location, user=None, passwd=None): | 28 | def load_to_str(location, user=None, passwd=None): |
| 31 | '''Load a destination URL or file into a string. | 29 | '''Load a destination URL or file into a string. |
| 32 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py | 30 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py |
| 33 | index 26b5de9..264ba05 100644 | 31 | index e44099b..e68174d 100644 |
| 34 | --- a/pykickstart/parser.py | 32 | --- a/pykickstart/parser.py |
| 35 | +++ b/pykickstart/parser.py | 33 | +++ b/pykickstart/parser.py |
| 36 | @@ -57,6 +57,26 @@ STATE_COMMANDS = "commands" | 34 | @@ -55,6 +55,20 @@ from pykickstart.i18n import _ |
| 37 | 35 | STATE_END = "end" | |
| 38 | ver = version.DEVEL | 36 | STATE_COMMANDS = "commands" |
| 39 | 37 | ||
| 40 | +import logging | ||
| 41 | +log = logging.getLogger("anaconda") | ||
| 42 | + | ||
| 43 | +import inspect | ||
| 44 | +import threading | 38 | +import threading |
| 45 | +_private_ks_lock = threading.RLock() | 39 | +_private_ks_lock = threading.RLock() |
| 46 | + | 40 | + |
| 47 | +class KsLock(object): | 41 | +class KsLock(object): |
| 48 | + def __enter__(self): | 42 | + def __enter__(self): |
| 49 | + log.info("%s %s" % (self.__class__.__name__, inspect.stack()[0][3])) | ||
| 50 | + _private_ks_lock.acquire() | 43 | + _private_ks_lock.acquire() |
| 51 | + return _private_ks_lock | 44 | + return _private_ks_lock |
| 52 | + | 45 | + |
| 53 | + def __exit__(self, exc_type, exc_val, exc_tb): | 46 | + def __exit__(self, exc_type, exc_val, exc_tb): |
| 54 | + log.info("%s %s" % (self.__class__.__name__, inspect.stack()[0][3])) | ||
| 55 | + _private_ks_lock.release() | 47 | + _private_ks_lock.release() |
| 56 | + | 48 | + |
| 57 | + | 49 | + |
| 58 | +_ks_lock = KsLock() | 50 | +_ks_lock = KsLock() |
| 59 | + | 51 | + |
| 60 | def _preprocessStateMachine (lineIter): | 52 | def _preprocessStateMachine(lineIter): |
| 61 | l = None | 53 | l = None |
| 62 | lineno = 0 | 54 | lineno = 0 |
| 63 | @@ -774,6 +794,10 @@ class KickstartParser(object): | 55 | @@ -788,6 +802,10 @@ class KickstartParser(object): |
| 64 | self._stateMachine (i) | 56 | self._stateMachine(i) |
| 65 | 57 | ||
| 66 | def readKickstart(self, f, reset=True, username=None, password=None): | 58 | def readKickstart(self, f, reset=True, username=None, password=None): |
| 67 | + with _ks_lock: | 59 | + with _ks_lock: |
diff --git a/meta-python/recipes-extended/python-pykickstart/files/0003-comment-out-sections-shutdown-and-environment-in-gen.patch b/meta-python/recipes-extended/python-pykickstart/files/0003-comment-out-sections-shutdown-and-environment-in-gen.patch index 9fb25fb18f..81e351b11f 100644 --- a/meta-python/recipes-extended/python-pykickstart/files/0003-comment-out-sections-shutdown-and-environment-in-gen.patch +++ b/meta-python/recipes-extended/python-pykickstart/files/0003-comment-out-sections-shutdown-and-environment-in-gen.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From be6012a5dd49ae5e8ac035654ab1c6f37f0dc8f4 Mon Sep 17 00:00:00 2001 | 1 | From 44226393812399c61de9ca9281efa002ad4f4c01 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: Thu, 1 Jun 2017 15:15:15 +0800 | 3 | Date: Thu, 1 Jun 2017 15:15:15 +0800 |
| 4 | Subject: [PATCH 3/4] comment out sections shutdown and environment in | 4 | Subject: [PATCH 3/4] comment out sections shutdown and environment in |
| @@ -17,10 +17,10 @@ fixup! add comments of shutdown for user | |||
| 17 | 2 files changed, 4 insertions(+), 1 deletion(-) | 17 | 2 files changed, 4 insertions(+), 1 deletion(-) |
| 18 | 18 | ||
| 19 | diff --git a/pykickstart/commands/reboot.py b/pykickstart/commands/reboot.py | 19 | diff --git a/pykickstart/commands/reboot.py b/pykickstart/commands/reboot.py |
| 20 | index 88799ba..2d0cea9 100644 | 20 | index 2c1b1c0..b3ec717 100644 |
| 21 | --- a/pykickstart/commands/reboot.py | 21 | --- a/pykickstart/commands/reboot.py |
| 22 | +++ b/pykickstart/commands/reboot.py | 22 | +++ b/pykickstart/commands/reboot.py |
| 23 | @@ -41,6 +41,9 @@ class FC3_Reboot(KickstartCommand): | 23 | @@ -43,6 +43,9 @@ class FC3_Reboot(KickstartCommand): |
| 24 | elif self.action == KS_SHUTDOWN: | 24 | elif self.action == KS_SHUTDOWN: |
| 25 | retval += "# Shutdown after installation\nshutdown" | 25 | retval += "# Shutdown after installation\nshutdown" |
| 26 | retval += self._getArgsAsStr() + "\n" | 26 | retval += self._getArgsAsStr() + "\n" |
| @@ -31,10 +31,10 @@ index 88799ba..2d0cea9 100644 | |||
| 31 | return retval | 31 | return retval |
| 32 | 32 | ||
| 33 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py | 33 | diff --git a/pykickstart/parser.py b/pykickstart/parser.py |
| 34 | index 264ba05..b3f33d7 100644 | 34 | index e68174d..efd78a6 100644 |
| 35 | --- a/pykickstart/parser.py | 35 | --- a/pykickstart/parser.py |
| 36 | +++ b/pykickstart/parser.py | 36 | +++ b/pykickstart/parser.py |
| 37 | @@ -383,7 +383,7 @@ class Packages(KickstartObject): | 37 | @@ -385,7 +385,7 @@ class Packages(KickstartObject): |
| 38 | 38 | ||
| 39 | if not self.default: | 39 | if not self.default: |
| 40 | if self.environment: | 40 | if self.environment: |
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 70254f6fda..c950be6389 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,6 +1,6 @@ | |||
| 1 | From c0e63f0d3c09bdabb0ad2c88b7cc73e7618dd86a Mon Sep 17 00:00:00 2001 | 1 | From a86ba22d7133199d850ef3d893571f27d6b0faed 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: Thu, 15 Jun 2017 17:35:33 +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 4/4] 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 |
| @@ -12,11 +12,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 | pykickstart/load.py | 30 ++++++++++++++++++++++++++++++ | 15 | pykickstart/load.py | 31 +++++++++++++++++++++++++++++++ |
| 16 | 1 file changed, 30 insertions(+) | 16 | 1 file changed, 31 insertions(+) |
| 17 | 17 | ||
| 18 | diff --git a/pykickstart/load.py b/pykickstart/load.py | 18 | diff --git a/pykickstart/load.py b/pykickstart/load.py |
| 19 | index 48c8276..74b266b 100644 | 19 | index 7adb751..b62245e 100644 |
| 20 | --- a/pykickstart/load.py | 20 | --- a/pykickstart/load.py |
| 21 | +++ b/pykickstart/load.py | 21 | +++ b/pykickstart/load.py |
| 22 | @@ -21,6 +21,7 @@ import requests | 22 | @@ -21,6 +21,7 @@ import requests |
| @@ -32,12 +32,12 @@ index 48c8276..74b266b 100644 | |||
| 32 | from requests.exceptions import SSLError, RequestException | 32 | from requests.exceptions import SSLError, RequestException |
| 33 | 33 | ||
| 34 | +import logging | 34 | +import logging |
| 35 | +log = logging.getLogger("anaconda") | 35 | +log = logging.getLogger("anaconda.main") |
| 36 | + | 36 | + |
| 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 | @@ -74,6 +78,29 @@ def load_to_file(location, destination): | 40 | @@ -73,6 +77,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,16 +67,17 @@ index 48c8276..74b266b 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 | @@ -96,6 +123,9 @@ def _get_auth(location, user=None, passwd=None): | 70 | @@ -94,6 +121,10 @@ def _get_auth(location, user=None, passwd=None): |
| 71 | def _load_url(location, user=None, passwd=None): | ||
| 72 | '''Load a location (URL or filename) and return contents as string''' | ||
| 73 | 71 | ||
| 72 | def _load_url(location, user=None, passwd=None): | ||
| 73 | '''Load a location (URL or filename) and return contents as string''' | ||
| 74 | + | ||
| 74 | + if not _access_url(location): | 75 | + if not _access_url(location): |
| 75 | + raise KickstartError(_("Connection %s failed" % location)) | 76 | + raise KickstartError(_("Connection %s failed" % location)) |
| 76 | + | 77 | + |
| 77 | auth = _get_auth(location, user=user, passwd=passwd) | 78 | auth = _get_auth(location, user=user, passwd=passwd) |
| 78 | |||
| 79 | try: | 79 | try: |
| 80 | request = requests.get(location, verify=SSL_VERIFY, auth=auth) | ||
| 80 | -- | 81 | -- |
| 81 | 2.7.4 | 82 | 2.7.4 |
| 82 | 83 | ||
diff --git a/meta-python/recipes-extended/python-pykickstart/files/0005-tweak-shebang-to-python3.patch b/meta-python/recipes-extended/python-pykickstart/files/0005-tweak-shebang-to-python3.patch deleted file mode 100644 index 3d614955b2..0000000000 --- a/meta-python/recipes-extended/python-pykickstart/files/0005-tweak-shebang-to-python3.patch +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | From 8a1f598223bd4cbcc877eb2aba3f5586c75c9d14 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 3 | Date: Mon, 21 Aug 2017 10:05:06 +0800 | ||
| 4 | Subject: [PATCH] tweak shebang to python3 | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | |||
| 8 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 9 | --- | ||
| 10 | tools/ksvalidator.py | 2 +- | ||
| 11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 12 | |||
| 13 | diff --git a/tools/ksvalidator.py b/tools/ksvalidator.py | ||
| 14 | index d6051d5..c3682e8 100755 | ||
| 15 | --- a/tools/ksvalidator.py | ||
| 16 | +++ b/tools/ksvalidator.py | ||
| 17 | @@ -1,4 +1,4 @@ | ||
| 18 | -#!/usr/bin/python | ||
| 19 | +#!/usr/bin/python3 | ||
| 20 | # | ||
| 21 | # Chris Lumens <clumens@redhat.com> | ||
| 22 | # | ||
| 23 | -- | ||
| 24 | 1.8.3.1 | ||
| 25 | |||
diff --git a/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_2.35.bb b/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.15.bb index 8c13f3ed14..07876a984c 100644 --- a/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_2.35.bb +++ b/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_3.15.bb | |||
| @@ -12,14 +12,13 @@ RDEPENDS_${PN} = "python3 \ | |||
| 12 | " | 12 | " |
| 13 | 13 | ||
| 14 | S = "${WORKDIR}/git" | 14 | S = "${WORKDIR}/git" |
| 15 | SRC_URI = "git://github.com/rhinstaller/pykickstart.git;protocol=https;branch=pykickstart-2 \ | 15 | SRC_URI = "git://github.com/rhinstaller/pykickstart.git;protocol=https;branch=master \ |
| 16 | file://0001-support-authentication-for-kickstart.patch \ | 16 | file://0001-support-authentication-for-kickstart.patch \ |
| 17 | file://0002-pykickstart-parser.py-add-lock-for-readKickstart-and.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 \ | 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 | file://0005-tweak-shebang-to-python3.patch \ | ||
| 21 | " | 20 | " |
| 22 | SRCREV = "b2787a818540e678c2f9c5dca0c6bbd65b8b55e5" | 21 | SRCREV = "07c4d89129fa6b460acc86daf58eb5ff64cdc832" |
| 23 | 22 | ||
| 24 | UPSTREAM_CHECK_GITTAGREGEX = "r(?P<pver>\d+(\.\d+)+(-\d+)*)" | 23 | UPSTREAM_CHECK_GITTAGREGEX = "r(?P<pver>\d+(\.\d+)+(-\d+)*)" |
| 25 | 24 | ||
