Skip to content

Commit 4014259

Browse files
author
Glenn Snyder
committed
fixing regression issue in getting unmapped code (aka scan) locations
1 parent 818b9fb commit 4014259

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

blackduck/HubRestApi.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,11 @@ def get_codelocations(self, limit=100, unmapped=False, parameters={}):
12601260
url = self.get_apibase() + "/codelocations" + paramstring
12611261
headers['Accept'] = 'application/vnd.blackducksoftware.scan-4+json'
12621262
response = requests.get(url, headers=headers, verify = not self.config['insecure'])
1263-
return response.json()
1263+
jsondata = response.json()
1264+
if unmapped:
1265+
jsondata['items'] = [s for s in jsondata['items'] if 'mappedProjectVersion' not in s]
1266+
jsondata['totalCount'] = len(jsondata['items'])
1267+
return jsondata
12641268

12651269
def get_codelocation_scan_summaries(self, code_location_id = None, code_location_obj = None, limit=100):
12661270
'''Retrieve the scans (aka scan summaries) for the given location. You can give either

blackduck/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
VERSION = (0, 0, 38)
1+
VERSION = (0, 0, 39)
22

33
__version__ = '.'.join(map(str, VERSION))

0 commit comments

Comments
 (0)