Skip to content

Commit b9a7ab5

Browse files
committed
Fix issue with CoreNodeSync
1 parent 337956d commit b9a7ab5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

infrahub_sdk/protocols_generator/generator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def render(self, sync: bool = True) -> str:
6666
nodes=self.sorted_nodes,
6767
profiles=self.sorted_profiles,
6868
base_protocols=self.base_protocols,
69+
core_node_name="CoreNodeSync" if sync else "CoreNode",
6970
sync=sync,
7071
)
7172

infrahub_sdk/protocols_generator/template.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if TYPE_CHECKING:
4545
{% for generic in generics %}
4646

4747

48-
class {{ generic.namespace + generic.name }}(CoreNode):
48+
class {{ generic.namespace + generic.name }}({{core_node_name}}):
4949
{% if not generic.attributes|default([]) and not generic.relationships|default([]) %}
5050
pass
5151
{% endif %}
@@ -68,7 +68,7 @@ class {{ generic.namespace + generic.name }}(CoreNode):
6868
{% for node in nodes %}
6969

7070

71-
class {{ node.namespace + node.name }}({{ node.inherit_from | join(", ") or "CoreNode" }}):
71+
class {{ node.namespace + node.name }}({{ node.inherit_from | join(", ") or core_node_name }}):
7272
{% if not node.attributes|default([]) and not node.relationships|default([]) %}
7373
pass
7474
{% endif %}
@@ -91,7 +91,7 @@ class {{ node.namespace + node.name }}({{ node.inherit_from | join(", ") or "Cor
9191
{% for node in profiles %}
9292

9393

94-
class {{ node.namespace + node.name }}({{ node.inherit_from | join(", ") or "CoreNode" }}):
94+
class {{ node.namespace + node.name }}({{ node.inherit_from | join(", ") or core_node_name }}):
9595
{% if not node.attributes|default([]) and not node.relationships|default([]) %}
9696
pass
9797
{% endif %}

0 commit comments

Comments
 (0)