Skip to content

Commit 711c410

Browse files
committed
Simplified bom upload function
1 parent c71a5d0 commit 711c410

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/scanoss/export/dependency_track.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,7 @@ def upload_sbom_contents(self, sbom_content: dict, project_id, project_name, pro
182182
payload = _build_payload(self._encode_sbom(sbom_content), project_id, project_name, project_version)
183183
url = f'{self.url}/api/v1/bom'
184184
headers = {'Content-Type': 'application/json', 'X-Api-Key': self.apikey}
185-
if self.trace:
186-
self.print_stderr(f'URL: {url}')
187-
self.print_stderr(f'Headers: {headers}')
188-
self.print_stderr(f'Payload keys: {list(payload.keys())}')
185+
self.print_trace(f'URL: {url}, Headers: {headers}, Payload keys: {list(payload.keys())}')
189186
self.print_msg('Uploading SBOM to Dependency Track...')
190187
response = requests.put(url, json=payload, headers=headers)
191188
response.raise_for_status()

0 commit comments

Comments
 (0)