aboutsummaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/blackduck-upload.bbclass1
-rw-r--r--classes/fossology-python.bbclass15
2 files changed, 9 insertions, 7 deletions
diff --git a/classes/blackduck-upload.bbclass b/classes/blackduck-upload.bbclass
index cad3ad5..b40efeb 100644
--- a/classes/blackduck-upload.bbclass
+++ b/classes/blackduck-upload.bbclass
@@ -17,6 +17,7 @@ inherit copyleft_filter
inherit spdx-common
do_upload[dirs] = "${SPDX_TOPDIR}"
+do_bd_upload[network] = "1"
WAIT_TIME ?= "20"
diff --git a/classes/fossology-python.bbclass b/classes/fossology-python.bbclass
index 4e4a2e6..5dfc1e2 100644
--- a/classes/fossology-python.bbclass
+++ b/classes/fossology-python.bbclass
@@ -198,8 +198,7 @@ def create_folder(d, foss, token, folder_name):
create_folder_lock.release()
if folder.name != folder_name:
bb.error("Folder %s couldn't be created" % folder_name)
- else:
- return folder
+ return folder
python do_schedule_jobs(){
import os
@@ -434,7 +433,7 @@ python do_get_report(){
while i < 20:
i += 1
try:
- report = foss.download_report(report_id)
+ report, name = foss.download_report(report_id, wait_time=wait_time*2)
except TryAgain:
bb.warn("SPDX file is still not ready, try again.")
time.sleep(wait_time)
@@ -446,10 +445,12 @@ python do_get_report(){
bb.error("Fail to download report.")
break
- report = str(report).lstrip("('")
- report = report.rstrip("')")
- with open(spdx_file, "w+") as file:
- file.write(report)
+ with open(spdx_file, "wb") as file:
+ written = file.write(report)
+ assert written == len(report)
+ logger.info(
+ f"Report written to file: report_name {name} written to {spdx_file}"
+ )
file.close()
subprocess.call(r"sed -i -e 's#\\n#\n#g' %s" % spdx_file, shell=True)