]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oe/sbom30: Remove unneeded oe.sbom30. to reference local symbol
authorBenjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>
Mon, 20 Apr 2026 07:44:32 +0000 (09:44 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 20 Apr 2026 16:58:37 +0000 (17:58 +0100)
The class OEDocumentExtension is declared within the sbom30.py file.
There is no need to use its full package path to reference it.
Same for get_element_link_id() function.

Signed-off-by: Benjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/sbom30.py

index b386b0f55bd3a9ede234c924fe18596cf8407bea..9f50821af087de338e683dfa538ca014fa27d0b8 100644 (file)
@@ -279,7 +279,7 @@ class ObjectSet(oe.spdx30.SHACLObjectSet):
 
     def is_native(self):
         for e in self.doc.extension:
-            if not isinstance(e, oe.sbom30.OEDocumentExtension):
+            if not isinstance(e, OEDocumentExtension):
                 continue
 
             if e.is_native is not None:
@@ -289,14 +289,14 @@ class ObjectSet(oe.spdx30.SHACLObjectSet):
 
     def set_is_native(self, is_native):
         for e in self.doc.extension:
-            if not isinstance(e, oe.sbom30.OEDocumentExtension):
+            if not isinstance(e, OEDocumentExtension):
                 continue
 
             e.is_native = is_native
             return
 
         if is_native:
-            self.doc.extension.append(oe.sbom30.OEDocumentExtension(is_native=True))
+            self.doc.extension.append(OEDocumentExtension(is_native=True))
 
     def add_aliases(self):
         for o in self.foreach_type(oe.spdx30.Element):
@@ -633,7 +633,7 @@ class ObjectSet(oe.spdx30.SHACLObjectSet):
         self.new_relationship(
             [spdx_file],
             oe.spdx30.RelationshipType.hasDeclaredLicense,
-            [oe.sbom30.get_element_link_id(lic_alias) for lic_alias in file_licenses],
+            [get_element_link_id(lic_alias) for lic_alias in file_licenses],
         )
         spdx_file.extension.append(OELicenseScannedExtension())