Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog/+artifact_methods.changed.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Changes InfrahubNode `artifact_fetch` and `artifact_generate` methods to use the name of the artifact instead of the name of the artifact definition
Changes InfrahubNode/InfrahubNodeSync `artifact_fetch` and `artifact_generate` methods to use the name of the artifact instead of the name of the artifact definition
4 changes: 2 additions & 2 deletions infrahub_sdk/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1635,13 +1635,13 @@ def generate(self, nodes: list[str] | None = None) -> None:

def artifact_generate(self, name: str) -> None:
self._validate_artifact_support(ARTIFACT_GENERATE_FEATURE_NOT_SUPPORTED_MESSAGE)
artifact = self._client.get(kind="CoreArtifact", definition__name__value=name, object__ids=[self.id])
artifact = self._client.get(kind="CoreArtifact", name__value=name, object__ids=[self.id])
artifact.definition.fetch() # type: ignore[attr-defined]
artifact.definition.peer.generate([artifact.id]) # type: ignore[attr-defined]

def artifact_fetch(self, name: str) -> str | dict[str, Any]:
self._validate_artifact_support(ARTIFACT_FETCH_FEATURE_NOT_SUPPORTED_MESSAGE)
artifact = self._client.get(kind="CoreArtifact", definition__name__value=name, object__ids=[self.id])
artifact = self._client.get(kind="CoreArtifact", name__value=name, object__ids=[self.id])
content = self._client.object_store.get(identifier=artifact.storage_id.value) # type: ignore[attr-defined]
return content

Expand Down