Skip to content

Commit 6f3180a

Browse files
committed
[SP-3346] chore: pr comments
1 parent 8ca101c commit 6f3180a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/scanoss/cryptography.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def get_algorithms(self) -> Optional[Dict]:
147147
Optional[Dict]: The folder hash response from the gRPC client, or None if an error occurs.
148148
"""
149149

150-
if not self.components_request:
150+
if not self.components_request or not self.components_request.get('components'):
151151
raise ScanossCryptographyError('No PURLs supplied. Provide --purl or --input.')
152152
components_str = ', '.join(p['purl'] for p in self.components_request['components'])
153153
self.base.print_stderr(f'Getting cryptographic algorithms for {components_str}')
@@ -170,7 +170,7 @@ def get_encryption_hints(self) -> Optional[Dict]:
170170
Optional[Dict]: The encryption hints response from the gRPC client, or None if an error occurs.
171171
"""
172172

173-
if not self.components_request:
173+
if not self.components_request or not self.components_request.get('components'):
174174
raise ScanossCryptographyError('No PURLs supplied. Provide --purl or --input.')
175175
self.base.print_stderr(
176176
f'Getting encryption hints '
@@ -194,7 +194,7 @@ def get_versions_in_range(self) -> Optional[Dict]:
194194
Optional[Dict]: The versions in range response from the gRPC client, or None if an error occurs.
195195
"""
196196

197-
if not self.components_request:
197+
if not self.components_request or not self.components_request.get('components'):
198198
raise ScanossCryptographyError('No PURLs supplied. Provide --purl or --input.')
199199

200200
components_str = ', '.join(p['purl'] for p in self.components_request['components'])

src/scanoss/scanossgrpc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ def get_component_versions_json(self, search: dict, use_grpc: bool = None) -> di
415415
search,
416416
CompVersionRequest,
417417
'Sending component version data for decoration (rqId: {rqId})...',
418+
use_grpc=use_grpc,
418419
)
419420

420421
def folder_hash_scan(self, request: Dict) -> Optional[Dict]:

0 commit comments

Comments
 (0)