From 6cd4162a586489aab650f9b45a684e1e48e60374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Nie=C3=9F?= Date: Sat, 4 Mar 2023 20:36:47 +0100 Subject: [PATCH] fix: Export files not working with Netbox 3.3 fixes: #187 --- .../netbox_virtualization_cluster types.csv | 2 -- .../v3.2/netbox_virtualization_clusters.csv | 2 -- .../netbox_dcim_device roles.csv | 0 .../{v3.2 => v3.3}/netbox_dcim_platforms.csv | 0 .../{v3.2 => v3.3}/netbox_dcim_sites.csv | 0 .../netbox_extras_custom fields.csv | 22 +++++++++---------- .../{v3.2 => v3.3}/netbox_extras_tags.csv | 0 .../{v3.2 => v3.3}/netbox_ipam_RIRs.csv | 0 .../{v3.2 => v3.3}/netbox_ipam_roles.csv | 0 .../netbox_virtualization_cluster types.csv | 2 ++ .../v3.3/netbox_virtualization_clusters.csv | 2 ++ examples/main.tf | 2 +- .../resource_netbox_virtualization_vm_test.go | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 examples/exports/v3.2/netbox_virtualization_cluster types.csv delete mode 100644 examples/exports/v3.2/netbox_virtualization_clusters.csv rename examples/exports/{v3.2 => v3.3}/netbox_dcim_device roles.csv (100%) rename examples/exports/{v3.2 => v3.3}/netbox_dcim_platforms.csv (100%) rename examples/exports/{v3.2 => v3.3}/netbox_dcim_sites.csv (100%) rename examples/exports/{v3.2 => v3.3}/netbox_extras_custom fields.csv (79%) rename examples/exports/{v3.2 => v3.3}/netbox_extras_tags.csv (100%) rename examples/exports/{v3.2 => v3.3}/netbox_ipam_RIRs.csv (100%) rename examples/exports/{v3.2 => v3.3}/netbox_ipam_roles.csv (100%) create mode 100644 examples/exports/v3.3/netbox_virtualization_cluster types.csv create mode 100644 examples/exports/v3.3/netbox_virtualization_clusters.csv diff --git a/examples/exports/v3.2/netbox_virtualization_cluster types.csv b/examples/exports/v3.2/netbox_virtualization_cluster types.csv deleted file mode 100644 index 62b980014..000000000 --- a/examples/exports/v3.2/netbox_virtualization_cluster types.csv +++ /dev/null @@ -1,2 +0,0 @@ -name,description,slug -test,"Test Cluster Type",test diff --git a/examples/exports/v3.2/netbox_virtualization_clusters.csv b/examples/exports/v3.2/netbox_virtualization_clusters.csv deleted file mode 100644 index 7f4be1c11..000000000 --- a/examples/exports/v3.2/netbox_virtualization_clusters.csv +++ /dev/null @@ -1,2 +0,0 @@ -name,type -test,test diff --git a/examples/exports/v3.2/netbox_dcim_device roles.csv b/examples/exports/v3.3/netbox_dcim_device roles.csv similarity index 100% rename from examples/exports/v3.2/netbox_dcim_device roles.csv rename to examples/exports/v3.3/netbox_dcim_device roles.csv diff --git a/examples/exports/v3.2/netbox_dcim_platforms.csv b/examples/exports/v3.3/netbox_dcim_platforms.csv similarity index 100% rename from examples/exports/v3.2/netbox_dcim_platforms.csv rename to examples/exports/v3.3/netbox_dcim_platforms.csv diff --git a/examples/exports/v3.2/netbox_dcim_sites.csv b/examples/exports/v3.3/netbox_dcim_sites.csv similarity index 100% rename from examples/exports/v3.2/netbox_dcim_sites.csv rename to examples/exports/v3.3/netbox_dcim_sites.csv diff --git a/examples/exports/v3.2/netbox_extras_custom fields.csv b/examples/exports/v3.3/netbox_extras_custom fields.csv similarity index 79% rename from examples/exports/v3.2/netbox_extras_custom fields.csv rename to examples/exports/v3.3/netbox_extras_custom fields.csv index e084ade2b..c49360b24 100644 --- a/examples/exports/v3.2/netbox_extras_custom fields.csv +++ b/examples/exports/v3.3/netbox_extras_custom fields.csv @@ -1,11 +1,11 @@ -name,content_types,label,type,required,description,weight,default,filter_logic,choices,object_type -cf_boolean,"virtualization.virtualmachine,tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,ipam.vlan,ipam.service,ipam.iprange","Boolean field",boolean,False,,100,,loose,, -cf_date,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,date,False,,100,,loose,, -cf_integer,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,integer,False,,100,,loose,, -cf_multi_selection,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,multiselect,False,,100,,loose,"0,1", -cf_selection,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,select,False,,100,,loose,"0,1", -cf_text,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,text,False,,100,,loose,, -cf_url,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,url,False,,100,,loose,, -cf_json,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,json,False,,100,,loose,, -cf_multi_object,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,multiobject,False,,100,,loose,,dcim.platform -cf_object,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,multiobject,False,,100,,loose,,dcim.platform +name,content_types,label,type,required,description,weight,default,filter_logic,choices,object_type,ui_visibility +cf_boolean,"virtualization.virtualmachine,tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,ipam.vlan,ipam.service,ipam.iprange","Boolean field",boolean,False,,100,,loose,,,read-write +cf_date,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,date,False,,100,,loose,,,read-write +cf_integer,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,integer,False,,100,,loose,,,read-write +cf_multi_selection,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,multiselect,False,,100,,loose,"0,1",,read-write +cf_selection,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,select,False,,100,,loose,"0,1",,read-write +cf_text,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,text,False,,100,,loose,,,read-write +cf_url,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,url,False,,100,,loose,,,read-write +cf_json,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,json,False,,100,,loose,,,read-write +cf_multi_object,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,multiobject,False,,100,,loose,,dcim.platform,read-write +cf_object,"tenancy.tenant,tenancy.contactrole,tenancy.contactgroup,ipam.aggregate,ipam.ipaddress,ipam.prefix,tenancy.contact,virtualization.virtualmachine,ipam.vlan,ipam.service,ipam.iprange",,multiobject,False,,100,,loose,,dcim.platform,read-write diff --git a/examples/exports/v3.2/netbox_extras_tags.csv b/examples/exports/v3.3/netbox_extras_tags.csv similarity index 100% rename from examples/exports/v3.2/netbox_extras_tags.csv rename to examples/exports/v3.3/netbox_extras_tags.csv diff --git a/examples/exports/v3.2/netbox_ipam_RIRs.csv b/examples/exports/v3.3/netbox_ipam_RIRs.csv similarity index 100% rename from examples/exports/v3.2/netbox_ipam_RIRs.csv rename to examples/exports/v3.3/netbox_ipam_RIRs.csv diff --git a/examples/exports/v3.2/netbox_ipam_roles.csv b/examples/exports/v3.3/netbox_ipam_roles.csv similarity index 100% rename from examples/exports/v3.2/netbox_ipam_roles.csv rename to examples/exports/v3.3/netbox_ipam_roles.csv diff --git a/examples/exports/v3.3/netbox_virtualization_cluster types.csv b/examples/exports/v3.3/netbox_virtualization_cluster types.csv new file mode 100644 index 000000000..c638b896d --- /dev/null +++ b/examples/exports/v3.3/netbox_virtualization_cluster types.csv @@ -0,0 +1,2 @@ +name,description,slug +"Test Cluster Type","Test Cluster Type",test_cluster_type diff --git a/examples/exports/v3.3/netbox_virtualization_clusters.csv b/examples/exports/v3.3/netbox_virtualization_clusters.csv new file mode 100644 index 000000000..8280f8c19 --- /dev/null +++ b/examples/exports/v3.3/netbox_virtualization_clusters.csv @@ -0,0 +1,2 @@ +name,type,status +"Test Cluster","Test Cluster Type",active diff --git a/examples/main.tf b/examples/main.tf index d530104eb..55184672f 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -525,7 +525,7 @@ resource "netbox_ipam_ip_addresses" "dynamic_ip_from_ip_range" { } data "netbox_virtualization_cluster" "cluster_test" { - name = "test" + name = "Test Cluster" } data "netbox_dcim_platform" "platform_test" { diff --git a/netbox/virtualization/resource_netbox_virtualization_vm_test.go b/netbox/virtualization/resource_netbox_virtualization_vm_test.go index df2fb2f3d..6a47ac43d 100644 --- a/netbox/virtualization/resource_netbox_virtualization_vm_test.go +++ b/netbox/virtualization/resource_netbox_virtualization_vm_test.go @@ -102,7 +102,7 @@ func testAccCheckNetboxVirtualizationVMConfig(nameSuffix string, resourceFull, e # type_id = netbox_virtualization_cluster_type.test.id #} data "netbox_virtualization_cluster" "cluster_test" { - name = "test" + name = "Test Cluster" } {{ if eq .extraresources "true" }}