* [PATCH] Add localhost to noproxy list.
@ 2020-03-30 13:37 Li, Xiaoming
2020-04-02 2:13 ` leimaohui
0 siblings, 1 reply; 2+ messages in thread
From: Li, Xiaoming @ 2020-03-30 13:37 UTC (permalink / raw)
To: yocto; +Cc: leimaohui
Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
---
classes/fossology-rest.bbclass | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/classes/fossology-rest.bbclass b/classes/fossology-rest.bbclass
index 48e16f3..000eefe 100644
--- a/classes/fossology-rest.bbclass
+++ b/classes/fossology-rest.bbclass
@@ -25,6 +25,8 @@ HOSTTOOLS_NONFATAL += "curl"
CREATOR_TOOL = "fossology-rest.bbclass in meta-spdxscanner"
+NO_PROXY = "localhost, 127.0.0.1"
+
# If ${S} isn't actually the top-level source directory, set SPDX_S to point at
# the real top-level directory.
SPDX_S ?= "${S}"
@@ -159,7 +161,7 @@ def get_folder_id_by_name(d, folder_name):
rest_api_cmd = "curl -k -s -S -X GET " + server_url + "/api/v1/folders" \
+ " -H \"Authorization: Bearer " + token + "\"" \
- + " --noproxy 127.0.0.1"
+ + " --noproxy " + NO_PROXY
bb.note("Invoke rest_api_cmd = " + rest_api_cmd )
try:
all_folder = subprocess.check_output(rest_api_cmd, stderr=subprocess.STDOUT, shell=True)
@@ -200,7 +202,7 @@ def create_folder(d, folder_name):
+ " -H \'parentFolder: 1\'" \
+ " -H \'folderName: " + folder_name + "\'" \
+ " -H \"Authorization: Bearer " + token + "\"" \
- + " --noproxy 127.0.0.1"
+ + " --noproxy " + NO_PROXY
bb.note("Invoke rest_api_cmd = " + rest_api_cmd)
try:
add_folder = subprocess.check_output(rest_api_cmd, stderr=subprocess.STDOUT, shell=True)
@@ -251,7 +253,7 @@ def has_upload(d, tar_file, folder_id):
rest_api_cmd = "curl -k -s -S -X GET " + server_url + "/api/v1/uploads" \
+ " -H \"Authorization: Bearer " + token + "\"" \
- + " --noproxy 127.0.0.1"
+ + " --noproxy " + NO_PROXY
bb.note("Invoke rest_api_cmd = " + rest_api_cmd )
try:
@@ -302,7 +304,7 @@ def upload(d, tar_file, folder):
+ " -H \'public: public\'" \
+ " -H \'Content-Type: multipart/form-data\'" \
+ " -F \'fileInput=@\"" + tar_file + "\";type=application/octet-stream\'" \
- + " --noproxy 127.0.0.1"
+ + " --noproxy " + NO_PROXY
bb.note("Upload : Invoke rest_api_cmd = " + rest_api_cmd )
while i < 10:
time.sleep(delaytime)
@@ -343,7 +345,7 @@ def analysis(d, folder_id, upload_id):
+ " -H \"Authorization: Bearer " + token + "\"" \
+ " -H \'Content-Type: application/json\'" \
+ " --data \'{\"analysis\": {\"bucket\": true,\"copyright_email_author\": true,\"ecc\": true, \"keyword\": true,\"mime\": true,\"monk\": true,\"nomos\": true,\"package\": true},\"decider\": {\"nomos_monk\": true,\"bulk_reused\": true,\"new_scanner\": true}}\'" \
- + " --noproxy 127.0.0.1"
+ + " --noproxy " + NO_PROXY
bb.note("Analysis : Invoke rest_api_cmd = " + rest_api_cmd )
while i < 10:
try:
@@ -389,7 +391,7 @@ def trigger(d, folder_id, upload_id):
+ " -H \"Authorization: Bearer " + token + "\"" \
+ " -H \"uploadId: " + str(upload_id) + "\"" \
+ " -H \'reportFormat: spdx2tv\'" \
- + " --noproxy 127.0.0.1"
+ + " --noproxy " + NO_PROXY
bb.note("trigger : Invoke rest_api_cmd = " + rest_api_cmd )
while i < 10:
time.sleep(delaytime)
@@ -431,7 +433,7 @@ def get_spdx(d, report_id, spdx_file):
rest_api_cmd = "curl -k -s -S -X GET " + server_url + "/api/v1/report/" + report_id \
+ " -H \'accept: text/plain\'" \
+ " -H \"Authorization: Bearer " + token + "\"" \
- + " --noproxy 127.0.0.1"
+ + " --noproxy " + NO_PROXY
bb.note("get_spdx : Invoke rest_api_cmd = " + rest_api_cmd )
while i < 10:
time.sleep(delaytime)
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Add localhost to noproxy list.
2020-03-30 13:37 [PATCH] Add localhost to noproxy list Li, Xiaoming
@ 2020-04-02 2:13 ` leimaohui
0 siblings, 0 replies; 2+ messages in thread
From: leimaohui @ 2020-04-02 2:13 UTC (permalink / raw)
To: Li, Xiaoming, yocto
Merged. Thank you.
> -----Original Message-----
> From: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
> Sent: Monday, March 30, 2020 9:37 PM
> To: yocto@lists.yoctoproject.org
> Cc: Lei, Maohui <leimaohui@cn.fujitsu.com>
> Subject: [PATCH] Add localhost to noproxy list.
>
> Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
> ---
> classes/fossology-rest.bbclass | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/classes/fossology-rest.bbclass b/classes/fossology-rest.bbclass index
> 48e16f3..000eefe 100644
> --- a/classes/fossology-rest.bbclass
> +++ b/classes/fossology-rest.bbclass
> @@ -25,6 +25,8 @@ HOSTTOOLS_NONFATAL += "curl"
>
> CREATOR_TOOL = "fossology-rest.bbclass in meta-spdxscanner"
>
> +NO_PROXY = "localhost, 127.0.0.1"
> +
> # If ${S} isn't actually the top-level source directory, set SPDX_S to point at # the
> real top-level directory.
> SPDX_S ?= "${S}"
> @@ -159,7 +161,7 @@ def get_folder_id_by_name(d, folder_name):
>
> rest_api_cmd = "curl -k -s -S -X GET " + server_url + "/api/v1/folders" \
> + " -H \"Authorization: Bearer " + token + "\"" \
> - + " --noproxy 127.0.0.1"
> + + " --noproxy " + NO_PROXY
> bb.note("Invoke rest_api_cmd = " + rest_api_cmd )
> try:
> all_folder = subprocess.check_output(rest_api_cmd,
> stderr=subprocess.STDOUT, shell=True) @@ -200,7 +202,7 @@ def
> create_folder(d, folder_name):
> + " -H \'parentFolder: 1\'" \
> + " -H \'folderName: " + folder_name + "\'" \
> + " -H \"Authorization: Bearer " + token + "\"" \
> - + " --noproxy 127.0.0.1"
> + + " --noproxy " + NO_PROXY
> bb.note("Invoke rest_api_cmd = " + rest_api_cmd)
> try:
> add_folder = subprocess.check_output(rest_api_cmd,
> stderr=subprocess.STDOUT, shell=True) @@ -251,7 +253,7 @@ def
> has_upload(d, tar_file, folder_id):
>
> rest_api_cmd = "curl -k -s -S -X GET " + server_url + "/api/v1/uploads" \
> + " -H \"Authorization: Bearer " + token + "\"" \
> - + " --noproxy 127.0.0.1"
> + + " --noproxy " + NO_PROXY
> bb.note("Invoke rest_api_cmd = " + rest_api_cmd )
>
> try:
> @@ -302,7 +304,7 @@ def upload(d, tar_file, folder):
> + " -H \'public: public\'" \
> + " -H \'Content-Type: multipart/form-data\'" \
> + " -F \'fileInput=@\"" + tar_file + "\";type=application/octet-
> stream\'" \
> - + " --noproxy 127.0.0.1"
> + + " --noproxy " + NO_PROXY
> bb.note("Upload : Invoke rest_api_cmd = " + rest_api_cmd )
> while i < 10:
> time.sleep(delaytime)
> @@ -343,7 +345,7 @@ def analysis(d, folder_id, upload_id):
> + " -H \"Authorization: Bearer " + token + "\"" \
> + " -H \'Content-Type: application/json\'" \
> + " --data \'{\"analysis\": {\"bucket\":
> true,\"copyright_email_author\": true,\"ecc\": true, \"keyword\": true,\"mime\":
> true,\"monk\": true,\"nomos\": true,\"package\": true},\"decider\":
> {\"nomos_monk\": true,\"bulk_reused\": true,\"new_scanner\": true}}\'" \
> - + " --noproxy 127.0.0.1"
> + + " --noproxy " + NO_PROXY
> bb.note("Analysis : Invoke rest_api_cmd = " + rest_api_cmd )
> while i < 10:
> try:
> @@ -389,7 +391,7 @@ def trigger(d, folder_id, upload_id):
> + " -H \"Authorization: Bearer " + token + "\"" \
> + " -H \"uploadId: " + str(upload_id) + "\"" \
> + " -H \'reportFormat: spdx2tv\'" \
> - + " --noproxy 127.0.0.1"
> + + " --noproxy " + NO_PROXY
> bb.note("trigger : Invoke rest_api_cmd = " + rest_api_cmd )
> while i < 10:
> time.sleep(delaytime)
> @@ -431,7 +433,7 @@ def get_spdx(d, report_id, spdx_file):
> rest_api_cmd = "curl -k -s -S -X GET " + server_url + "/api/v1/report/" +
> report_id \
> + " -H \'accept: text/plain\'" \
> + " -H \"Authorization: Bearer " + token + "\"" \
> - + " --noproxy 127.0.0.1"
> + + " --noproxy " + NO_PROXY
> bb.note("get_spdx : Invoke rest_api_cmd = " + rest_api_cmd )
> while i < 10:
> time.sleep(delaytime)
> --
> 2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-02 2:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-30 13:37 [PATCH] Add localhost to noproxy list Li, Xiaoming
2020-04-02 2:13 ` leimaohui
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.