Skip to content

Commit

Permalink
fix: Fix resource names #183
Browse files Browse the repository at this point in the history
  • Loading branch information
vaerh committed May 15, 2023
1 parent eb49b20 commit a4314d0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions routeros/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ func Provider() *schema.Provider {
"routeros_capsman_security": ResourceCapsManSecurity(),

// Routing
"routeros_routing_table": ResourceRoutingTable(),
"routeros_bgp_connection": ResourceBGPConnection(),
"routeros_bgp_template": ResourceBGPTemplate(),
"routeros_routing_table": ResourceRoutingTable(),
"routeros_routing_bgp_connection": ResourceRoutingBGPConnection(),
"routeros_routing_bgp_template": ResourceRoutingBGPTemplate(),

// VPN
"routeros_ovpn_server": ResourceOpenVPNServer(),
Expand Down
2 changes: 1 addition & 1 deletion routeros/resource_bgp_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import (
*/

// https://help.mikrotik.com/docs/display/ROS/BGP#BGP-ConnectionMenu
func ResourceBGPConnection() *schema.Resource {
func ResourceRoutingBGPConnection() *schema.Resource {
resSchema := map[string]*schema.Schema{
MetaResourcePath: PropResourcePath("/routing/bgp/connection"),
MetaId: PropId(Id),
Expand Down
6 changes: 3 additions & 3 deletions routeros/resource_bgp_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform-plugin-testing/terraform"
)

const testBGPConnectionAddress = "routeros_bgp_connection.test"
const testBGPConnectionAddress = "routeros_routing_bgp_connection.test"

func TestAccBGPConnectionTest_basic(t *testing.T) {
for _, name := range testNames {
Expand All @@ -19,7 +19,7 @@ func TestAccBGPConnectionTest_basic(t *testing.T) {
testSetTransportEnv(t, name)
},
ProviderFactories: testAccProviderFactories,
CheckDestroy: testCheckResourceDestroy("/routing/bgp/connection", "routeros_bgp_connection"),
CheckDestroy: testCheckResourceDestroy("/routing/bgp/connection", "routeros_routing_bgp_connection"),
Steps: []resource.TestStep{
{
Config: testAccBGPConnectionConfig(),
Expand Down Expand Up @@ -52,7 +52,7 @@ func testAccCheckBGPConnectionExists(name string) resource.TestCheckFunc {
func testAccBGPConnectionConfig() string {
return providerConfig + `
resource "routeros_bgp_connection" "test" {
resource "routeros_routing_bgp_connection" "test" {
name = "neighbor-test"
as = "65550/5"
as_override = true
Expand Down
2 changes: 1 addition & 1 deletion routeros/resource_bgp_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import (
*/

// https://help.mikrotik.com/docs/display/ROS/
func ResourceBGPTemplate() *schema.Resource {
func ResourceRoutingBGPTemplate() *schema.Resource {
resSchema := map[string]*schema.Schema{
MetaResourcePath: PropResourcePath("/routing/bgp/template"),
MetaId: PropId(Id),
Expand Down
6 changes: 3 additions & 3 deletions routeros/resource_bgp_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform-plugin-testing/terraform"
)

const testBGPTemplateAddress = "routeros_bgp_template.test"
const testBGPTemplateAddress = "routeros_routing_bgp_template.test"

func TestAccBGPTemplateTest_basic(t *testing.T) {
for _, name := range testNames {
Expand All @@ -19,7 +19,7 @@ func TestAccBGPTemplateTest_basic(t *testing.T) {
testSetTransportEnv(t, name)
},
ProviderFactories: testAccProviderFactories,
CheckDestroy: testCheckResourceDestroy("/routing/bgp/template", "routeros_bgp_template"),
CheckDestroy: testCheckResourceDestroy("/routing/bgp/template", "routeros_routing_bgp_template"),
Steps: []resource.TestStep{
{
Config: testAccBGPTemplateConfig(),
Expand Down Expand Up @@ -52,7 +52,7 @@ func testAccCheckBGPTemplateExists(name string) resource.TestCheckFunc {
func testAccBGPTemplateConfig() string {
return providerConfig + `
resource "routeros_bgp_template" "test" {
resource "routeros_routing_bgp_template" "test" {
name = "test-template"
as = 65521
input {
Expand Down

0 comments on commit a4314d0

Please sign in to comment.