Skip to content

Commit 0d491c0

Browse files
authored
Merge pull request #266 from opsmill/wvd-20250210-fix-node-artifact-methods
Update InfrahubNode artifact_fetch and artifact_generate methods to use artiface name instead of the defintion name
2 parents 7f1ebbb + 86024fc commit 0d491c0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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

infrahub_sdk/node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,14 +1118,14 @@ async def generate(self, nodes: list[str] | None = None) -> None:
11181118
async def artifact_generate(self, name: str) -> None:
11191119
self._validate_artifact_support(ARTIFACT_GENERATE_FEATURE_NOT_SUPPORTED_MESSAGE)
11201120

1121-
artifact = await self._client.get(kind="CoreArtifact", definition__name__value=name, object__ids=[self.id])
1121+
artifact = await self._client.get(kind="CoreArtifact", name__value=name, object__ids=[self.id])
11221122
await artifact.definition.fetch() # type: ignore[attr-defined]
11231123
await artifact.definition.peer.generate([artifact.id]) # type: ignore[attr-defined]
11241124

11251125
async def artifact_fetch(self, name: str) -> str | dict[str, Any]:
11261126
self._validate_artifact_support(ARTIFACT_GENERATE_FEATURE_NOT_SUPPORTED_MESSAGE)
11271127

1128-
artifact = await self._client.get(kind="CoreArtifact", definition__name__value=name, object__ids=[self.id])
1128+
artifact = await self._client.get(kind="CoreArtifact", name__value=name, object__ids=[self.id])
11291129
content = await self._client.object_store.get(identifier=artifact.storage_id.value) # type: ignore[attr-defined]
11301130
return content
11311131

0 commit comments

Comments
 (0)