Skip to content

Commit

Permalink
trivial: Correctly save multiple ini payloads and evidence
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsie committed Dec 13, 2024
1 parent fa2d991 commit 8d7fba4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions uswid/format_ini.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,18 @@ def _save_component(self, component: uSwidComponent) -> bytes:
config[key] = self._save_link(link)

# payload
for i, link in enumerate(component.payloads):
for i, payload in enumerate(component.payloads):
key = "uSWID-Payload"
if i > 0:
key += f":{i}"
config[key] = self._save_payload(component.payloads[0])
config[key] = self._save_payload(payload)

# evidence
for i, link in enumerate(component.evidences):
for i, evidence in enumerate(component.evidences):
key = "uSWID-Evidence"
if i > 0:
key += f":{i}"
config[key] = self._save_evidence(component.evidences[0])
config[key] = self._save_evidence(evidence)

# as string
with io.StringIO() as f:
Expand Down

0 comments on commit 8d7fba4

Please sign in to comment.