]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/hashicorp/terraform/terraform/util.go
Merge branch 'fix_read_test' of github.com:alexandreFre/terraform-provider-statuscake
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / terraform / util.go
index f41f0d7d634aaf7b4bf0b96e3bb5d6306becad6f..752241af1ee438d53b82bd3e1cc8045b56fa808f 100644 (file)
@@ -2,7 +2,8 @@ package terraform
 
 import (
        "sort"
-       "strings"
+
+       "github.com/hashicorp/terraform/config"
 )
 
 // Semaphore is a wrapper around a channel to provide
@@ -47,21 +48,8 @@ func (s Semaphore) Release() {
        }
 }
 
-// resourceProvider returns the provider name for the given type.
-func resourceProvider(t, alias string) string {
-       if alias != "" {
-               return alias
-       }
-
-       idx := strings.IndexRune(t, '_')
-       if idx == -1 {
-               // If no underscores, the resource name is assumed to be
-               // also the provider name, e.g. if the provider exposes
-               // only a single resource of each type.
-               return t
-       }
-
-       return t[:idx]
+func resourceProvider(resourceType, explicitProvider string) string {
+       return config.ResourceProviderFullName(resourceType, explicitProvider)
 }
 
 // strSliceContains checks if a given string is contained in a slice