canonical / cpc-sbom

CPC maintained tool for generating SBOM for cloud images
GNU General Public License v3.0
7 stars 0 forks source link

fix: Resolve relative import issues when run as snap command #36

Closed philroche closed 1 year ago

philroche commented 1 year ago

When running cpc-sbom command as a snap error

19:09:46   File "/snap/cpc-sbom/x1/lib/python3.10/site-packages/cpc_sbom/__init__.py", line 2, in <module>
19:09:46     from generate import generate_sbom

was encountered. Changing to only import from generate when required solved the problem

philroche commented 1 year ago

This change has been tested manually as python console script, calling init.py directly and from snap. All work https://github.com/canonical/cpc-sbom/pull/36