@@ -1417,8 +1417,7 @@ def get_cf_objects(self):
1417
1417
url = self ._get_cf_url ()
1418
1418
if not hasattr (self , "_cf_objects" ):
1419
1419
logging .debug ("retrieving objects" )
1420
- custom_headers = {'Accept' : 'application/vnd.blackducksoftware.admin-4+json' }
1421
- response = self .execute_get (url , custom_headers = custom_headers )
1420
+ response = self .execute_get (url )
1422
1421
self ._cf_objects = response .json ()
1423
1422
return self ._cf_objects
1424
1423
@@ -1431,8 +1430,7 @@ def get_cf_object(self, object_name):
1431
1430
assert object_name in self .supported_cf_object_types (), "Object name {} not one of the supported types ({})" .format (object_name , self .supported_cf_object_types ())
1432
1431
1433
1432
object_url = self ._get_cf_object_url (object_name )
1434
- custom_headers = {'Accept' : 'application/vnd.blackducksoftware.admin-4+json' }
1435
- response = self .execute_get (object_url , custom_headers = custom_headers )
1433
+ response = self .execute_get (object_url )
1436
1434
return response .json ()
1437
1435
1438
1436
def _get_cf_obj_rel_path (self , object_name ):
@@ -1462,11 +1460,7 @@ def create_cf(self, object_name, field_type, description, label, position, activ
1462
1460
}
1463
1461
if field_type in types_using_initial_options and initial_options :
1464
1462
cf_request .update ({"initialOptions" : initial_options })
1465
- custom_headers = {
1466
- 'Content-Type' : 'application/vnd.blackducksoftware.admin-4+json' ,
1467
- 'Accept' : 'application/json'
1468
- }
1469
- response = self .execute_post (post_url , data = cf_request , custom_headers = custom_headers )
1463
+ response = self .execute_post (post_url , data = cf_request )
1470
1464
return response
1471
1465
1472
1466
def delete_cf (self , object_name , field_id ):
@@ -1486,8 +1480,7 @@ def get_custom_fields(self, object_name):
1486
1480
1487
1481
url = self ._get_cf_object_url (object_name ) + "/fields"
1488
1482
1489
- custom_headers = {'Accept' : 'application/vnd.blackducksoftware.admin-4+json' }
1490
- response = self .execute_get (url , custom_headers = custom_headers )
1483
+ response = self .execute_get (url )
1491
1484
return response .json ()
1492
1485
1493
1486
def get_cf_values (self , obj ):
@@ -1496,8 +1489,7 @@ def get_cf_values(self, obj):
1496
1489
The obj is expected to be the JSON document for a project, project-version, component, etc
1497
1490
'''
1498
1491
url = self .get_link (obj , "custom-fields" )
1499
- custom_headers = {'Accept' : 'application/vnd.blackducksoftware.component-detail-5+json' }
1500
- response = self .execute_get (url , custom_headers = custom_headers )
1492
+ response = self .execute_get (url )
1501
1493
return response .json ()
1502
1494
1503
1495
def get_cf_value (self , obj , field_id ):
@@ -1506,16 +1498,14 @@ def get_cf_value(self, obj, field_id):
1506
1498
The obj is expected to be the JSON document for a project, project-version, component, etc
1507
1499
'''
1508
1500
url = self .get_link (obj , "custom-fields" ) + "/{}" .format (field_id )
1509
- custom_headers = {'Accept' : 'application/vnd.blackducksoftware.component-detail-5+json' }
1510
- response = self .execute_get (url , custom_headers = custom_headers )
1501
+ response = self .execute_get (url )
1511
1502
return response .json ()
1512
1503
1513
1504
def put_cf_value (self , cf_url , new_cf_obj ):
1514
1505
'''new_cf_obj is expected to be a modified custom field value object with the values updated accordingly, e.g.
1515
1506
call get_cf_value, modify the object, and then call put_cf_value
1516
1507
'''
1517
- custom_headers = {'Accept' : 'application/vnd.blackducksoftware.component-detail-5+json' }
1518
- return self .execute_put (cf_url , new_cf_obj , custom_headers = custom_headers )
1508
+ return self .execute_put (cf_url , new_cf_obj )
1519
1509
1520
1510
##
1521
1511
#
0 commit comments