Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed python compatibility issue #60

Merged
merged 4 commits into from
Feb 12, 2025
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
42 changes: 37 additions & 5 deletions examples/infrahub_to_peering-manager/infrahub/sync_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@
class InfraAutonomousSystem(InfrahubModel):
_modelname = "InfraAutonomousSystem"
_identifiers = ("asn",)
_attributes = ("name", "description", "irr_as_set", "ipv4_max_prefixes", "ipv6_max_prefixes", "affiliated")
_attributes = (
"name",
"description",
"irr_as_set",
"ipv4_max_prefixes",
"ipv6_max_prefixes",
"affiliated",
)
name: str
asn: int
description: str | None = None
Expand All @@ -29,7 +36,13 @@ class InfraAutonomousSystem(InfrahubModel):
class InfraBGPPeerGroup(InfrahubModel):
_modelname = "InfraBGPPeerGroup"
_identifiers = ("name",)
_attributes = ("import_policies", "export_policies", "bgp_communities", "description", "status")
_attributes = (
"import_policies",
"export_policies",
"bgp_communities",
"description",
"status",
)
name: str
description: str | None = None
status: str | None = None
Expand Down Expand Up @@ -58,7 +71,14 @@ class InfraBGPCommunity(InfrahubModel):
class InfraBGPRoutingPolicy(InfrahubModel):
_modelname = "InfraBGPRoutingPolicy"
_identifiers = ("name",)
_attributes = ("bgp_communities", "label", "description", "policy_type", "weight", "address_family")
_attributes = (
"bgp_communities",
"label",
"description",
"policy_type",
"weight",
"address_family",
)
name: str
label: str | None = None
description: str | None = None
Expand All @@ -74,7 +94,13 @@ class InfraBGPRoutingPolicy(InfrahubModel):
class InfraIXP(InfrahubModel):
_modelname = "InfraIXP"
_identifiers = ("name",)
_attributes = ("import_policies", "export_policies", "bgp_communities", "description", "status")
_attributes = (
"import_policies",
"export_policies",
"bgp_communities",
"description",
"status",
)
name: str
description: str | None = None
status: str | None = "enabled"
Expand All @@ -89,7 +115,13 @@ class InfraIXP(InfrahubModel):
class InfraIXPConnection(InfrahubModel):
_modelname = "InfraIXPConnection"
_identifiers = ("name",)
_attributes = ("internet_exchange_point", "description", "peeringdb_netixlan", "status", "vlan")
_attributes = (
"internet_exchange_point",
"description",
"peeringdb_netixlan",
"status",
"vlan",
)
name: str
description: str | None = None
peeringdb_netixlan: int | None = None
Expand Down
42 changes: 37 additions & 5 deletions examples/infrahub_to_peering-manager/peeringmanager/sync_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@
class InfraAutonomousSystem(PeeringmanagerModel):
_modelname = "InfraAutonomousSystem"
_identifiers = ("asn",)
_attributes = ("name", "description", "irr_as_set", "ipv4_max_prefixes", "ipv6_max_prefixes", "affiliated")
_attributes = (
"name",
"description",
"irr_as_set",
"ipv4_max_prefixes",
"ipv6_max_prefixes",
"affiliated",
)
name: str
asn: int
description: str | None = None
Expand All @@ -29,7 +36,13 @@ class InfraAutonomousSystem(PeeringmanagerModel):
class InfraBGPPeerGroup(PeeringmanagerModel):
_modelname = "InfraBGPPeerGroup"
_identifiers = ("name",)
_attributes = ("import_policies", "export_policies", "bgp_communities", "description", "status")
_attributes = (
"import_policies",
"export_policies",
"bgp_communities",
"description",
"status",
)
name: str
description: str | None = None
status: str | None = None
Expand Down Expand Up @@ -58,7 +71,14 @@ class InfraBGPCommunity(PeeringmanagerModel):
class InfraBGPRoutingPolicy(PeeringmanagerModel):
_modelname = "InfraBGPRoutingPolicy"
_identifiers = ("name",)
_attributes = ("bgp_communities", "label", "description", "policy_type", "weight", "address_family")
_attributes = (
"bgp_communities",
"label",
"description",
"policy_type",
"weight",
"address_family",
)
name: str
label: str | None = None
description: str | None = None
Expand All @@ -74,7 +94,13 @@ class InfraBGPRoutingPolicy(PeeringmanagerModel):
class InfraIXP(PeeringmanagerModel):
_modelname = "InfraIXP"
_identifiers = ("name",)
_attributes = ("import_policies", "export_policies", "bgp_communities", "description", "status")
_attributes = (
"import_policies",
"export_policies",
"bgp_communities",
"description",
"status",
)
name: str
description: str | None = None
status: str | None = "enabled"
Expand All @@ -89,7 +115,13 @@ class InfraIXP(PeeringmanagerModel):
class InfraIXPConnection(PeeringmanagerModel):
_modelname = "InfraIXPConnection"
_identifiers = ("name",)
_attributes = ("internet_exchange_point", "description", "peeringdb_netixlan", "status", "vlan")
_attributes = (
"internet_exchange_point",
"description",
"peeringdb_netixlan",
"status",
"vlan",
)
name: str
description: str | None = None
peeringdb_netixlan: int | None = None
Expand Down
19 changes: 17 additions & 2 deletions examples/ipfabric_to_infrahub/infrahub/sync_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
class InfraDevice(InfrahubModel):
_modelname = "InfraDevice"
_identifiers = ("hostname",)
_attributes = ("model", "location", "platform", "version", "fqdn", "serial_number", "hardware_serial_number")
_attributes = (
"model",
"location",
"platform",
"version",
"fqdn",
"serial_number",
"hardware_serial_number",
)
fqdn: str | None = None
hostname: str
serial_number: str
Expand Down Expand Up @@ -71,7 +79,14 @@ class InfraNOSVersion(InfrahubModel):
class InfraPartNumber(InfrahubModel):
_modelname = "InfraPartNumber"
_identifiers = ("device", "name")
_attributes = ("model", "manufacturer", "part_vid", "part_id", "description", "part_sn")
_attributes = (
"model",
"manufacturer",
"part_vid",
"part_id",
"description",
"part_sn",
)
name: str
part_vid: str | None = None
part_id: str | None = None
Expand Down
19 changes: 17 additions & 2 deletions examples/ipfabric_to_infrahub/ipfabricsync/sync_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
class InfraDevice(IpfabricsyncModel):
_modelname = "InfraDevice"
_identifiers = ("hostname",)
_attributes = ("model", "location", "platform", "version", "fqdn", "serial_number", "hardware_serial_number")
_attributes = (
"model",
"location",
"platform",
"version",
"fqdn",
"serial_number",
"hardware_serial_number",
)
fqdn: str | None = None
hostname: str
serial_number: str
Expand Down Expand Up @@ -71,7 +79,14 @@ class InfraNOSVersion(IpfabricsyncModel):
class InfraPartNumber(IpfabricsyncModel):
_modelname = "InfraPartNumber"
_identifiers = ("device", "name")
_attributes = ("model", "manufacturer", "part_vid", "part_id", "description", "part_sn")
_attributes = (
"model",
"manufacturer",
"part_vid",
"part_id",
"description",
"part_sn",
)
name: str
part_vid: str | None = None
part_id: str | None = None
Expand Down
30 changes: 27 additions & 3 deletions examples/nautobot-v1_to_infrahub/infrahub/sync_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,15 @@ class InfraCircuit(InfrahubModel):
class InfraDevice(InfrahubModel):
_modelname = "InfraDevice"
_identifiers = ("location", "organization", "name")
_attributes = ("model", "rack", "role", "tags", "platform", "serial_number", "asset_tag")
_attributes = (
"model",
"rack",
"role",
"tags",
"platform",
"serial_number",
"asset_tag",
)
name: str | None = None
serial_number: str | None = None
asset_tag: str | None = None
Expand Down Expand Up @@ -104,7 +112,15 @@ class InfraIPAddress(InfrahubModel):
class InfraInterfaceL2L3(InfrahubModel):
_modelname = "InfraInterfaceL2L3"
_identifiers = ("name", "device")
_attributes = ("tagged_vlan", "tags", "l2_mode", "description", "mgmt_only", "mac_address", "interface_type")
_attributes = (
"tagged_vlan",
"tags",
"l2_mode",
"description",
"mgmt_only",
"mac_address",
"interface_type",
)
l2_mode: str | None = None
name: str
description: str | None = None
Expand Down Expand Up @@ -161,7 +177,15 @@ class InfraProviderNetwork(InfrahubModel):
class InfraRack(InfrahubModel):
_modelname = "InfraRack"
_identifiers = ("name",)
_attributes = ("location", "role", "tags", "height", "facility_id", "serial_number", "asset_tag")
_attributes = (
"location",
"role",
"tags",
"height",
"facility_id",
"serial_number",
"asset_tag",
)
name: str
height: int | None = None
facility_id: str | None = None
Expand Down
30 changes: 27 additions & 3 deletions examples/nautobot-v1_to_infrahub/nautobot/sync_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ class InfraCircuit(NautobotModel):
class InfraDevice(NautobotModel):
_modelname = "InfraDevice"
_identifiers = ("location", "organization", "name")
_attributes = ("model", "rack", "role", "tags", "platform", "serial_number", "asset_tag")
_attributes = (
"model",
"rack",
"role",
"tags",
"platform",
"serial_number",
"asset_tag",
)
name: str | None = None
serial_number: str | None = None
asset_tag: str | None = None
Expand Down Expand Up @@ -111,7 +119,15 @@ class InfraIPAddress(NautobotModel):
class InfraInterfaceL2L3(NautobotModel):
_modelname = "InfraInterfaceL2L3"
_identifiers = ("name", "device")
_attributes = ("tagged_vlan", "tags", "l2_mode", "description", "mgmt_only", "mac_address", "interface_type")
_attributes = (
"tagged_vlan",
"tags",
"l2_mode",
"description",
"mgmt_only",
"mac_address",
"interface_type",
)
l2_mode: str | None = None
name: str
description: str | None = None
Expand Down Expand Up @@ -172,7 +188,15 @@ class InfraProviderNetwork(NautobotModel):
class InfraRack(NautobotModel):
_modelname = "InfraRack"
_identifiers = ("name",)
_attributes = ("location", "role", "tags", "height", "facility_id", "serial_number", "asset_tag")
_attributes = (
"location",
"role",
"tags",
"height",
"facility_id",
"serial_number",
"asset_tag",
)
name: str
height: int | None = None
facility_id: str | None = None
Expand Down
42 changes: 38 additions & 4 deletions examples/nautobot-v2_to_infrahub/infrahub/sync_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ class InfraCircuit(InfrahubModel):
class InfraDevice(InfrahubModel):
_modelname = "InfraDevice"
_identifiers = ("location", "organization", "name")
_attributes = ("model", "tags", "rack", "role", "status", "platform", "serial_number", "asset_tag")
_attributes = (
"model",
"tags",
"rack",
"role",
"status",
"platform",
"serial_number",
"asset_tag",
)
serial_number: str | None = None
asset_tag: str | None = None
name: str | None = None
Expand Down Expand Up @@ -113,7 +122,16 @@ class InfraIPAddress(InfrahubModel):
class InfraInterfaceL2L3(InfrahubModel):
_modelname = "InfraInterfaceL2L3"
_identifiers = ("name", "device")
_attributes = ("status", "tags", "tagged_vlan", "l2_mode", "mac_address", "description", "mgmt_only", "interface_type")
_attributes = (
"status",
"tags",
"tagged_vlan",
"l2_mode",
"mac_address",
"description",
"mgmt_only",
"interface_type",
)
l2_mode: str | None = None
mac_address: str | None = None
description: str | None = None
Expand Down Expand Up @@ -178,7 +196,15 @@ class InfraProviderNetwork(InfrahubModel):
class InfraRack(InfrahubModel):
_modelname = "InfraRack"
_identifiers = ("name",)
_attributes = ("role", "location", "tags", "facility_id", "asset_tag", "serial_number", "height")
_attributes = (
"role",
"location",
"tags",
"facility_id",
"asset_tag",
"serial_number",
"height",
)
facility_id: str | None = None
asset_tag: str | None = None
name: str
Expand Down Expand Up @@ -220,7 +246,15 @@ class InfraRouteTarget(InfrahubModel):
class InfraVLAN(InfrahubModel):
_modelname = "InfraVLAN"
_identifiers = ("name",)
_attributes = ("role", "organization", "vlan_group", "status", "locations", "description", "vlan_id")
_attributes = (
"role",
"organization",
"vlan_group",
"status",
"locations",
"description",
"vlan_id",
)
name: str
description: str | None = None
vlan_id: int
Expand Down
Loading