anthonyharrison / lib4sbom

Library to ingest and generate SBOMs
Apache License 2.0
14 stars 10 forks source link

NameError Exception When 'package_info' Contains 'description' Field #7

Closed sentient6 closed 11 months ago

sentient6 commented 11 months ago

Hi,

the variable "fpackage_info" has not been declared in this context.

This can lead to a NameError exception like so:

  File "/root/.local/lib/python3.11/site-packages/lib4sbom/generator.py", line 78, in generate
    self._generate_spdx(project_name, sbom_data)
  File "/root/.local/lib/python3.11/site-packages/lib4sbom/generator.py", line 133, in _generate_spdx
    self.bom.generatePackageDetails(
  File "/root/.local/lib/python3.11/site-packages/lib4sbom/spdx/spdx_generator.py", line 443, in generatePackageDetails
    self.generateJSONPackageDetails(
  File "/root/.local/lib/python3.11/site-packages/lib4sbom/spdx/spdx_generator.py", line 335, in generateJSONPackageDetails
    component["description"] = fpackage_info["description"]
                               ^^^^^^^^^^^^^
NameError: name 'fpackage_info' is not defined. Did you mean: 'package_info'?

Cheers!

anthonyharrison commented 11 months ago

Fixed in release 0.4.0