Skip to content

Commit

Permalink
fix(upnp): Fix "unknown parameter forced-external-ip"
Browse files Browse the repository at this point in the history
Changed to `forced_ip`
  • Loading branch information
vaerh committed Apr 9, 2024
1 parent c5febbd commit 68bb1a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions routeros/resource_ip_upnp_interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ func ResourceUPNPInterfaces() *schema.Resource {

KeyDisabled: PropDisabledRw,
KeyDynamic: PropDynamicRo,
"forced_ip": {
Type: schema.TypeString,
Optional: true,
Description: "Allow specifying what public IP to use if the external interface has more than one IP available.",
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
"interface": {
Type: schema.TypeString,
Required: true,
Expand All @@ -27,12 +33,6 @@ func ResourceUPNPInterfaces() *schema.Resource {
internal - router's local interface the clients are connected to`,
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
"forced_external_ip": {
Type: schema.TypeString,
Optional: true,
Description: "Allow specifying what public IP to use if the external interface has more than one IP available.",
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
}
return &schema.Resource{
CreateContext: DefaultCreate(resSchema),
Expand Down
6 changes: 3 additions & 3 deletions routeros/resource_ip_upnp_interfaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ func TestAccUPNPInterfacesTest_basic(t *testing.T) {
ProviderFactories: testAccProviderFactories,
Steps: []resource.TestStep{
{
Config: testAccUPNPInterfacesConfig("ether1", "external", `forced_external_ip = "0.0.0.0"`),
Config: testAccUPNPInterfacesConfig("ether1", "external", `forced_ip = "0.0.0.0"`),
Check: resource.ComposeTestCheckFunc(
testResourcePrimaryInstanceId(testUPNPInterfaces),
resource.TestCheckResourceAttr(testUPNPInterfaces, "interface", "ether1"),
resource.TestCheckResourceAttr(testUPNPInterfaces, "type", "external"),
resource.TestCheckResourceAttr(testUPNPInterfaces, "forced_external_ip", "0.0.0.0"),
resource.TestCheckResourceAttr(testUPNPInterfaces, "forced_ip", "0.0.0.0"),
),
},
{
Expand All @@ -34,7 +34,7 @@ func TestAccUPNPInterfacesTest_basic(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(testUPNPInterfaces, "interface", "ether1"),
resource.TestCheckResourceAttr(testUPNPInterfaces, "type", "internal"),
resource.TestCheckNoResourceAttr(testUPNPInterfaces, "forced_external_ip"),
resource.TestCheckNoResourceAttr(testUPNPInterfaces, "forced_ip"),
),
},
},
Expand Down

0 comments on commit 68bb1a0

Please sign in to comment.