diff --git a/changelog/+artifact_methods.changed.md b/changelog/+artifact_methods.changed.md index 6aa2b60b..72ec55e9 100644 --- a/changelog/+artifact_methods.changed.md +++ b/changelog/+artifact_methods.changed.md @@ -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 diff --git a/infrahub_sdk/node.py b/infrahub_sdk/node.py index 5be89a01..f34a7b5a 100644 --- a/infrahub_sdk/node.py +++ b/infrahub_sdk/node.py @@ -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