-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Caution
AI generated report follows
Summary
When assigning paths to variant.paths.repository[arch], variant.paths.debug_repository[arch], or variant.paths.source_repository[arch], there is no way to set different values for url and local_path in the resulting Location object.
Environment
- productmd version: Development branch commit
b719ac380fa94a3c68093479957d3ae1aab75c6b - Python version: 3.14.3
Current Behavior
When assigning to variant paths, the behavior varies depending on the type assigned:
-
Assigning a string: Both
urlandlocal_pathare set to the same string valuevariant.paths.repository["x86_64"] = "https://example.com/repo" # Results in: url="https://example.com/repo", local_path="https://example.com/repo"
-
Assigning a dict: Causes
TypeErrorduring serializationvariant.paths.repository["x86_64"] = { "url": "https://example.com/repo", "local_path": "compose/repo" } # Results in: TypeError during ci.dump() - productmd tries to assign the dict to local_path
-
Assigning a Location object: Causes
TypeErrorduring serializationfrom productmd.common import Location loc = Location() loc.url = "https://example.com/repo" loc.local_path = "compose/repo" variant.paths.repository["x86_64"] = loc # Results in: TypeError - productmd wraps it in another Location, setting local_path to the Location object
Expected Behavior
Users should be able to assign a Location object directly without re-wrapping it in another Location
Example of desired usage:
from productmd.composeinfo import ComposeInfo, Variant
ci = ComposeInfo()
# ... set up compose metadata ...
variant = Variant(ci)
variant.id = "BaseOS"
variant.uid = "BaseOS"
variant.name = "BaseOS"
variant.type = "variant"
variant.arches = {"x86_64"}
ci.variants.add(variant)
from productmd.common import Location
loc = Location()
loc.url = "https://pulp.example.com/pulp/content/RHEL-10-10.0-20260311.0/BaseOS-x86_64"
loc.local_path = "BaseOS/x86_64/os"
variant.paths.repository["x86_64"] = loc
ci.dump("composeinfo.json")Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels