aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/hashicorp/terraform/terraform/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/terraform/util.go')
-rw-r--r--vendor/github.com/hashicorp/terraform/terraform/util.go20
1 files changed, 4 insertions, 16 deletions
diff --git a/vendor/github.com/hashicorp/terraform/terraform/util.go b/vendor/github.com/hashicorp/terraform/terraform/util.go
index f41f0d7..752241a 100644
--- a/vendor/github.com/hashicorp/terraform/terraform/util.go
+++ b/vendor/github.com/hashicorp/terraform/terraform/util.go
@@ -2,7 +2,8 @@ package terraform
2 2
3import ( 3import (
4 "sort" 4 "sort"
5 "strings" 5
6 "github.com/hashicorp/terraform/config"
6) 7)
7 8
8// Semaphore is a wrapper around a channel to provide 9// Semaphore is a wrapper around a channel to provide
@@ -47,21 +48,8 @@ func (s Semaphore) Release() {
47 } 48 }
48} 49}
49 50
50// resourceProvider returns the provider name for the given type. 51func resourceProvider(resourceType, explicitProvider string) string {
51func resourceProvider(t, alias string) string { 52 return config.ResourceProviderFullName(resourceType, explicitProvider)
52 if alias != "" {
53 return alias
54 }
55
56 idx := strings.IndexRune(t, '_')
57 if idx == -1 {
58 // If no underscores, the resource name is assumed to be
59 // also the provider name, e.g. if the provider exposes
60 // only a single resource of each type.
61 return t
62 }
63
64 return t[:idx]
65} 53}
66 54
67// strSliceContains checks if a given string is contained in a slice 55// strSliceContains checks if a given string is contained in a slice