change class to instance call
@@ -177,12 +177,12 @@ class CycloneDX:
file_name = Path(resource.file_path).name
if check_type is CheckType.SCA_IMAGE:
package_type = resource.vulnerability_details['package_type']
- image_distro_name = resource.vulnerability_details.get('image_details', ImageDetails).distro.split(' ')[0]
+ image_distro_name = resource.vulnerability_details.get('image_details', ImageDetails()).distro.split(' ')[0]
file_path = resource.file_path.split(' ')[0]
if package_type == 'os':
purl_type = IMAGE_DISTRO_TO_PURL_TYPE.get(image_distro_name, 'generic')
namespace = f'{self.repo_id}/{file_path}/{image_distro_name.lower()}'
- qualifiers = f'distro={resource.vulnerability_details.get("image_details", ImageDetails).distro_release}'
+ qualifiers = f'distro={resource.vulnerability_details.get("image_details", ImageDetails()).distro_release}'
else:
purl_type = TWISTCLI_PACKAGE_TYPE_TO_PURL_TYPE.get(package_type, 'generic')
namespace = f"{self.repo_id}/{file_path}"
@@ -216,7 +216,7 @@ class CycloneDX:
def create_image_component(self, resource: Record, bom: Bom) -> None:
image_id = cast(Dict[str, Any], resource.vulnerability_details).get('image_details',
- ImageDetails).image_id
+ ImageDetails()).image_id
file_path = resource.file_path.split(' ')[0]
image_purl = PackageURL(
type='oci',
