diff --git a/builtin/providers/openstack/resource_openstack_networking_network_v2.go b/builtin/providers/openstack/resource_openstack_networking_network_v2.go index 7101abe3c..e4b1eab72 100644 --- a/builtin/providers/openstack/resource_openstack_networking_network_v2.go +++ b/builtin/providers/openstack/resource_openstack_networking_network_v2.go @@ -107,7 +107,7 @@ func resourceNetworkingNetworkV2Create(d *schema.ResourceData, meta interface{}) createOpts := NetworkCreateOpts{ Name: d.Get("name").(string), TenantID: d.Get("tenant_id").(string), - ValueSpecs: networkValueSpecs(d), + ValueSpecs: MapValueSpecs(d), } asuRaw := d.Get("admin_state_up").(string) @@ -284,11 +284,3 @@ func waitForNetworkDelete(networkingClient *gophercloud.ServiceClient, networkId return n, "ACTIVE", nil } } - -func networkValueSpecs(d *schema.ResourceData) map[string]string { - m := make(map[string]string) - for key, val := range d.Get("value_specs").(map[string]interface{}) { - m[key] = val.(string) - } - return m -} diff --git a/builtin/providers/openstack/resource_openstack_networking_router_v2.go b/builtin/providers/openstack/resource_openstack_networking_router_v2.go index caa714fd5..158b22aea 100644 --- a/builtin/providers/openstack/resource_openstack_networking_router_v2.go +++ b/builtin/providers/openstack/resource_openstack_networking_router_v2.go @@ -117,7 +117,7 @@ func resourceNetworkingRouterV2Create(d *schema.ResourceData, meta interface{}) createOpts := RouterCreateOpts{ Name: d.Get("name").(string), TenantID: d.Get("tenant_id").(string), - ValueSpecs: routerValueSpecs(d), + ValueSpecs: MapValueSpecs(d), } if asuRaw, ok := d.GetOk("admin_state_up"); ok { @@ -292,11 +292,3 @@ func waitForRouterDelete(networkingClient *gophercloud.ServiceClient, routerId s return r, "ACTIVE", nil } } - -func routerValueSpecs(d *schema.ResourceData) map[string]string { - m := make(map[string]string) - for key, val := range d.Get("value_specs").(map[string]interface{}) { - m[key] = val.(string) - } - return m -} diff --git a/builtin/providers/openstack/resource_openstack_networking_subnet_v2.go b/builtin/providers/openstack/resource_openstack_networking_subnet_v2.go index f3e6c5f05..8b6dc2017 100644 --- a/builtin/providers/openstack/resource_openstack_networking_subnet_v2.go +++ b/builtin/providers/openstack/resource_openstack_networking_subnet_v2.go @@ -141,7 +141,7 @@ func resourceNetworkingSubnetV2Create(d *schema.ResourceData, meta interface{}) HostRoutes: resourceSubnetHostRoutesV2(d), EnableDHCP: nil, }, - subnetValueSpecs(d), + MapValueSpecs(d), } if v, ok := d.GetOk("gateway_ip"); ok { @@ -384,11 +384,3 @@ func waitForSubnetDelete(networkingClient *gophercloud.ServiceClient, subnetId s return s, "ACTIVE", nil } } - -func subnetValueSpecs(d *schema.ResourceData) map[string]string { - m := make(map[string]string) - for key, val := range d.Get("value_specs").(map[string]interface{}) { - m[key] = val.(string) - } - return m -}