mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-26 19:47:17 +00:00
python-pykickstart: fix typo
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
From b7070a79432b790dffa82401364e4fd8d906eb2b Mon Sep 17 00:00:00 2001
|
From f05f5fc363e2510f6943532f3e14a6423f6a2cf1 Mon Sep 17 00:00:00 2001
|
||||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
Date: Tue, 31 Jul 2018 17:24:47 +0800
|
Date: Tue, 31 Jul 2018 17:24:47 +0800
|
||||||
Subject: [PATCH 1/4] support authentication for kickstart
|
Subject: [PATCH 1/4] support authentication for kickstart
|
||||||
@@ -51,7 +51,7 @@ index bf08ac5..aada7aa 100644
|
|||||||
+ def __str__(self):
|
+ def __str__(self):
|
||||||
+ return self.value
|
+ return self.value
|
||||||
diff --git a/pykickstart/load.py b/pykickstart/load.py
|
diff --git a/pykickstart/load.py b/pykickstart/load.py
|
||||||
index fb935f2..c6f013f 100644
|
index fb935f2..41a2e9e 100644
|
||||||
--- a/pykickstart/load.py
|
--- a/pykickstart/load.py
|
||||||
+++ b/pykickstart/load.py
|
+++ b/pykickstart/load.py
|
||||||
@@ -18,10 +18,13 @@
|
@@ -18,10 +18,13 @@
|
||||||
@@ -101,7 +101,7 @@ index fb935f2..c6f013f 100644
|
|||||||
+ if user is None or passwd is None:
|
+ if user is None or passwd is None:
|
||||||
+ log.info("Require Authentication")
|
+ log.info("Require Authentication")
|
||||||
+ raise KickstartAuthError("Require Authentication.\nAppend 'ksuser=<username> kspasswd=<password>' to boot command")
|
+ raise KickstartAuthError("Require Authentication.\nAppend 'ksuser=<username> kspasswd=<password>' to boot command")
|
||||||
+
|
|
||||||
+ reasons = request.headers.get("WWW-Authenticate", "").split()
|
+ reasons = request.headers.get("WWW-Authenticate", "").split()
|
||||||
+ if reasons:
|
+ if reasons:
|
||||||
+ auth_type = reasons[0]
|
+ auth_type = reasons[0]
|
||||||
@@ -111,9 +111,9 @@ index fb935f2..c6f013f 100644
|
|||||||
+ auth=HTTPDigestAuth(user, passwd)
|
+ auth=HTTPDigestAuth(user, passwd)
|
||||||
+
|
+
|
||||||
+ return auth
|
+ return auth
|
||||||
|
+
|
||||||
+def _load_url(location, user=None, passwd=None):
|
+def _load_url(location, user=None, passwd=None):
|
||||||
+ '''Load a location (URL or filename) and return contents as string'''
|
+ '''Load a location (URL or filename) and return contents as string'''
|
||||||
+ auth = _get_auth(location, user=user, passwd=passwd)
|
+ auth = _get_auth(location, user=user, passwd=passwd)
|
||||||
try:
|
try:
|
||||||
- request = requests.get(location, verify=SSL_VERIFY)
|
- request = requests.get(location, verify=SSL_VERIFY)
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
From a86ba22d7133199d850ef3d893571f27d6b0faed Mon Sep 17 00:00:00 2001
|
From ffe06c6dd812b604d6482e4353d5564fad78bc90 Mon Sep 17 00:00:00 2001
|
||||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
Date: Mon, 30 Jul 2018 15:52:21 +0800
|
Date: Mon, 30 Jul 2018 15:52:21 +0800
|
||||||
Subject: [PATCH 4/4] load.py: retry to invoke request with timeout
|
Subject: [PATCH 4/4] load.py: retry to invoke request with timeout
|
||||||
@@ -16,7 +16,7 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
|||||||
1 file changed, 31 insertions(+)
|
1 file changed, 31 insertions(+)
|
||||||
|
|
||||||
diff --git a/pykickstart/load.py b/pykickstart/load.py
|
diff --git a/pykickstart/load.py b/pykickstart/load.py
|
||||||
index 7adb751..b62245e 100644
|
index ad3bad1..a5cbbc5 100644
|
||||||
--- a/pykickstart/load.py
|
--- a/pykickstart/load.py
|
||||||
+++ b/pykickstart/load.py
|
+++ b/pykickstart/load.py
|
||||||
@@ -21,6 +21,7 @@ import requests
|
@@ -21,6 +21,7 @@ import requests
|
||||||
@@ -70,7 +70,7 @@ index 7adb751..b62245e 100644
|
|||||||
@@ -94,6 +121,10 @@ def _get_auth(location, user=None, passwd=None):
|
@@ -94,6 +121,10 @@ def _get_auth(location, user=None, passwd=None):
|
||||||
|
|
||||||
def _load_url(location, user=None, passwd=None):
|
def _load_url(location, user=None, passwd=None):
|
||||||
'''Load a location (URL or filename) and return contents as string'''
|
'''Load a location (URL or filename) and return contents as string'''
|
||||||
+
|
+
|
||||||
+ if not _access_url(location):
|
+ if not _access_url(location):
|
||||||
+ raise KickstartError(_("Connection %s failed" % location))
|
+ raise KickstartError(_("Connection %s failed" % location))
|
||||||
|
|||||||
Reference in New Issue
Block a user