Skip to content

Commit f1faf4d

Browse files
committed
[SP-3346] chore: pr comments
1 parent ccf310d commit f1faf4d

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
@@ -125,7 +125,7 @@ def get_algorithms(self) -> Optional[Dict]:
125125
Optional[Dict]: The folder hash response from the gRPC client, or None if an error occurs.
126126
"""
127127

128-
if not self.components_request:
128+
if not self.components_request or not self.components_request.get('components'):
129129
raise ScanossCryptographyError('No PURLs supplied. Provide --purl or --input.')
130130
components_str = ', '.join(p['purl'] for p in self.components_request['components'])
131131
self.base.print_stderr(f'Getting cryptographic algorithms for {components_str}')
@@ -148,7 +148,7 @@ def get_encryption_hints(self) -> Optional[Dict]:
148148
Optional[Dict]: The encryption hints response from the gRPC client, or None if an error occurs.
149149
"""
150150

151-
if not self.components_request:
151+
if not self.components_request or not self.components_request.get('components'):
152152
raise ScanossCryptographyError('No PURLs supplied. Provide --purl or --input.')
153153
self.base.print_stderr(
154154
f'Getting encryption hints '
@@ -172,7 +172,7 @@ def get_versions_in_range(self) -> Optional[Dict]:
172172
Optional[Dict]: The versions in range response from the gRPC client, or None if an error occurs.
173173
"""
174174

175-
if not self.components_request:
175+
if not self.components_request or not self.components_request.get('components'):
176176
raise ScanossCryptographyError('No PURLs supplied. Provide --purl or --input.')
177177

178178
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
@@ -408,6 +408,7 @@ def get_component_versions_json(self, search: dict, use_grpc: bool = None) -> di
408408
search,
409409
CompVersionRequest,
410410
'Sending component version data for decoration (rqId: {rqId})...',
411+
use_grpc=use_grpc,
411412
)
412413

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

0 commit comments

Comments
 (0)