Delete unused methods (#905)

This commit is contained in:
Vincent Roseberry 2018-01-02 14:15:13 -05:00 committed by GitHub
parent fa58e0aa66
commit 283c8f89e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 2 additions and 58 deletions

View File

@ -233,16 +233,6 @@ func testAccCheckComputeHealthCheckExists(n string, healthCheck *compute.HealthC
}
}
func testAccCheckErrorCreating(n string) resource.TestCheckFunc {
return func(s *terraform.State) error {
_, ok := s.RootModule().Resources[n]
if ok {
return fmt.Errorf("HealthCheck %s created successfully with bad config", n)
}
return nil
}
}
func testAccCheckComputeHealthCheckThresholds(healthy, unhealthy int64, healthCheck *compute.HealthCheck) resource.TestCheckFunc {
return func(s *terraform.State) error {
if healthCheck.HealthyThreshold != healthy {

View File

@ -687,18 +687,3 @@ func resourceComputeUrlMapImportState(d *schema.ResourceData, meta interface{})
d.Set("name", d.Id())
return []*schema.ResourceData{d}, nil
}
func validateHostRules(v interface{}, k string) (ws []string, es []error) {
pathMatchers := make(map[string]bool)
hostRules := v.([]interface{})
for _, hri := range hostRules {
hr := hri.(map[string]interface{})
pm := hr["path_matcher"].(string)
if pathMatchers[pm] {
es = append(es, fmt.Errorf("Multiple host_rule entries with the same path_matcher are not allowed. Please collapse all hosts with the same path_matcher into one host_rule"))
return
}
pathMatchers[pm] = true
}
return
}

View File

@ -362,17 +362,3 @@ func getVpnTunnelLink(config *Config, project string, region string, tunnel stri
return tunnel, nil
}
func getVpnTunnelName(vpntunnel string) (string, error) {
if strings.HasPrefix(vpntunnel, "https://www.googleapis.com/compute/") {
// extract the VPN tunnel name from SelfLink URL
vpntunnelName := vpntunnel[strings.LastIndex(vpntunnel, "/")+1:]
if vpntunnelName == "" {
return "", fmt.Errorf("VPN tunnel url not valid")
}
return vpntunnelName, nil
}
return vpntunnel, nil
}

View File

@ -11,7 +11,6 @@ import (
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"google.golang.org/api/servicemanagement/v1"
)
// Test that services can be enabled and disabled on a project
@ -281,11 +280,3 @@ func testStringsToString(s []string) string {
log.Printf("[DEBUG]: Converted list of strings to %s", r)
return b.String()
}
func testManagedServicesToString(svcs []*servicemanagement.ManagedService) string {
var b bytes.Buffer
for _, s := range svcs {
b.WriteString(s.ServiceName)
}
return b.String()
}

View File

@ -19,7 +19,7 @@ func TestAccGoogleSqlDatabase_basic(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccGoogleSqlDatabaseInstanceDestroy,
CheckDestroy: testAccGoogleSqlDatabaseDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: fmt.Sprintf(
@ -46,7 +46,7 @@ func TestAccGoogleSqlDatabase_update(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccGoogleSqlDatabaseInstanceDestroy,
CheckDestroy: testAccGoogleSqlDatabaseDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: fmt.Sprintf(

View File

@ -298,14 +298,6 @@ func convertStringSet(set *schema.Set) []string {
return s
}
func convertArrToMap(ifaceArr []interface{}) map[string]struct{} {
sm := make(map[string]struct{})
for _, s := range ifaceArr {
sm[s.(string)] = struct{}{}
}
return sm
}
func mergeSchemas(a, b map[string]*schema.Schema) map[string]*schema.Schema {
merged := make(map[string]*schema.Schema)