Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
arjenvri committed Nov 4, 2022
1 parent 6dcbdc5 commit 9127073
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions netbox/resource_netbox_device_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func resourceNetboxDeviceInterface() *schema.Resource {
UpdateContext: resourceNetboxDeviceInterfaceUpdate,
DeleteContext: resourceNetboxDeviceInterfaceDelete,

Description: `:meta:subcategory:Device:From the [official documentation](https://docs.netbox.dev/en/stable/features/device/#interface):
Description: `:meta:subcategory:Dcim:From the [official documentation](https://docs.netbox.dev/en/stable/features/device/#interface):
> Interfaces in NetBox represent network interfaces used to exchange data with connected devices. On modern networks, these are most commonly Ethernet, but other types are supported as well. IP addresses and VLANs can be assigned to interfaces.`,
Schema: map[string]*schema.Schema{
Expand All @@ -46,9 +46,7 @@ func resourceNetboxDeviceInterface() *schema.Resource {
"mac_address": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringMatch(
regexp.MustCompile("^([A-Z0-9]{2}:){5}[A-Z0-9]{2}$"),
"Must be like AA:AA:AA:AA:AA"),
ValidateFunc: validation.IsMACAddress,
ForceNew: true,
},
"mgmtonly": {
Expand Down
2 changes: 1 addition & 1 deletion netbox/resource_netbox_device_interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ resource "netbox_device_role" "test" {
}
resource "netbox_manufacturer" "test" {
name = "%[1]s"
name = "%[1]s"
}
resource "netbox_device_type" "test" {
Expand Down
4 changes: 1 addition & 3 deletions netbox/resource_netbox_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ func resourceNetboxInterface() *schema.Resource {
"mac_address": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringMatch(
regexp.MustCompile("^([A-Z0-9]{2}:){5}[A-Z0-9]{2}$"),
"Must be like AA:AA:AA:AA:AA"),
ValidateFunc: validation.IsMACAddress,
ForceNew: true,
},
"mode": {
Expand Down

0 comments on commit 9127073

Please sign in to comment.