Skip to content

Commit

Permalink
fix: Add a helper for the attribute 'inactive'
Browse files Browse the repository at this point in the history
  • Loading branch information
vaerh committed Jun 19, 2023
1 parent f0db91e commit adca988
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
5 changes: 5 additions & 0 deletions routeros/provider_schema_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
KeyDynamic = "dynamic"
KeyDisabled = "disabled"
KeyFilter = "filter"
KeyInactive = "inactive"
KeyInterface = "interface"
KeyInvalid = "invalid"
KeyL2Mtu = "l2mtu"
Expand Down Expand Up @@ -142,6 +143,10 @@ var (
Elem: schema.TypeString,
Description: "Additional request filtering options.",
}
PropInactiveRo = &schema.Schema{
Type: schema.TypeBool,
Computed: true,
}
PropInterfaceRw = &schema.Schema{
Type: schema.TypeString,
Required: true,
Expand Down
5 changes: 1 addition & 4 deletions routeros/resource_interface_bridge_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,7 @@ func ResourceInterfaceBridgePort() *schema.Resource {
Computed: true,
Description: "Switch chip used by the port.",
},
"inactive": {
Type: schema.TypeBool,
Computed: true,
},
KeyInactive: PropInactiveRo,
"ingress_filtering": {
Type: schema.TypeBool,
Optional: true,
Expand Down
5 changes: 1 addition & 4 deletions routeros/resource_ip_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ func ResourceIPRoute() *schema.Resource {
Computed: true,
Description: "Shows actual (resolved) gateway and interface that will be used for packet forwarding.",
},
"inactive": {
Type: schema.TypeBool,
Computed: true,
},
KeyInactive: PropInactiveRo,
"pref_src": {
Type: schema.TypeString,
Optional: true,
Expand Down
5 changes: 1 addition & 4 deletions routeros/resource_ipv6_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ func ResourceIPv6Route() *schema.Resource {
Computed: true,
Description: "Shows actual (resolved) gateway and interface that will be used for packet forwarding.",
},
"inactive": {
Type: schema.TypeBool,
Computed: true,
},
KeyInactive: PropInactiveRo,
"pref_src": {
Type: schema.TypeString,
Optional: true,
Expand Down

0 comments on commit adca988

Please sign in to comment.