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
1 change: 1 addition & 0 deletions .vale/styles/Infrahub/sentence-case.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ exceptions:
- IP
- IP Fabric
- IPAM
- IPAddress
- IPHost
- IPNetwork
- JavaScript
Expand Down
2 changes: 2 additions & 0 deletions infrahub_sdk/node/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ARTIFACT_FETCH_FEATURE_NOT_SUPPORTED_MESSAGE,
ARTIFACT_GENERATE_FEATURE_NOT_SUPPORTED_MESSAGE,
HFID_STR_SEPARATOR,
IP_ADDRESS_TYPES,
IP_TYPES,
MATCHES_LOCAL_CHECKSUM_FEATURE_NOT_SUPPORTED_MESSAGE,
PROPERTIES_FLAG,
Expand All @@ -30,6 +31,7 @@
"ARTIFACT_FETCH_FEATURE_NOT_SUPPORTED_MESSAGE",
"ARTIFACT_GENERATE_FEATURE_NOT_SUPPORTED_MESSAGE",
"HFID_STR_SEPARATOR",
"IP_ADDRESS_TYPES",
"IP_TYPES",
"MATCHES_LOCAL_CHECKSUM_FEATURE_NOT_SUPPORTED_MESSAGE",
"PROPERTIES_FLAG",
Expand Down
4 changes: 2 additions & 2 deletions infrahub_sdk/node/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class Attribute:
def __init__(self, name: str, schema: AttributeSchemaAPI, data: Any | dict) -> None:
"""Build an ``Attribute`` from raw GraphQL data.

IP-typed attributes (``IPHost``, ``IPNetwork``) are parsed via the standard
``ipaddress`` module so the in-memory value is a network/interface object.
IP-typed attributes (``IPHost``, ``IPNetwork``, ``IPAddress``) are parsed via the standard
``ipaddress`` module so the in-memory value is an interface, network or address object.

Args:
name (str): The name of the attribute.
Expand Down
1 change: 1 addition & 0 deletions infrahub_sdk/schema/generated/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class AttributeKind(str, Enum):
BANDWIDTH = "Bandwidth"
IPHOST = "IPHost"
IPNETWORK = "IPNetwork"
IPADDRESS = "IPAddress"
BOOLEAN = "Boolean"
CHECKBOX = "Checkbox"
LIST = "List"
Expand Down
1 change: 1 addition & 0 deletions infrahub_sdk/schema/generated/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ class GenericAttributeRead(AttributeSchemaBaseRead):
AttributeKind.BANDWIDTH,
AttributeKind.IPHOST,
AttributeKind.IPNETWORK,
AttributeKind.IPADDRESS,
AttributeKind.BOOLEAN,
AttributeKind.CHECKBOX,
AttributeKind.JSON,
Expand Down
1 change: 1 addition & 0 deletions infrahub_sdk/schema/generated/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ class GenericAttributeWrite(AttributeSchemaBaseWrite):
AttributeKind.BANDWIDTH,
AttributeKind.IPHOST,
AttributeKind.IPNETWORK,
AttributeKind.IPADDRESS,
AttributeKind.BOOLEAN,
AttributeKind.CHECKBOX,
AttributeKind.JSON,
Expand Down
10 changes: 0 additions & 10 deletions tests/unit/sdk/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1787,11 +1787,6 @@ async def test_create_input_data_with_IPHost_attribute(
}


@pytest.mark.skip(
reason="The IPAddress attribute kind is not yet defined in the Infrahub backend, so the generated "
"AttributeKind enum omits it and the schema fixture cannot be built. Re-enable once the backend "
"adds the IPAddress attribute type."
)
@pytest.mark.parametrize("client_type", client_types)
async def test_create_input_data_with_IPAddress_attribute(
client: InfrahubClient, bare_ipaddress_schema: NodeSchemaAPI, client_type: str
Expand Down Expand Up @@ -2202,11 +2197,6 @@ async def test_node_IPHost_deserialization(
assert ip_address.address.value == ipaddress.ip_interface("1.1.1.1/24")


@pytest.mark.skip(
reason="The IPAddress attribute kind is not yet defined in the Infrahub backend, so the generated "
"AttributeKind enum omits it and the schema fixture cannot be built. Re-enable once the backend "
"adds the IPAddress attribute type."
)
@pytest.mark.parametrize("client_type", client_types)
async def test_node_IPAddress_deserialization(
client: InfrahubClient, bare_ipaddress_schema: NodeSchemaAPI, client_type: str
Expand Down