aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/hashicorp/terraform/plugin/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/plugin/client.go')
-rw-r--r--vendor/github.com/hashicorp/terraform/plugin/client.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/plugin/client.go b/vendor/github.com/hashicorp/terraform/plugin/client.go
index 3a5cb7a..7e2f4fe 100644
--- a/vendor/github.com/hashicorp/terraform/plugin/client.go
+++ b/vendor/github.com/hashicorp/terraform/plugin/client.go
@@ -1,8 +1,10 @@
1package plugin 1package plugin
2 2
3import ( 3import (
4 "os"
4 "os/exec" 5 "os/exec"
5 6
7 hclog "github.com/hashicorp/go-hclog"
6 plugin "github.com/hashicorp/go-plugin" 8 plugin "github.com/hashicorp/go-plugin"
7 "github.com/hashicorp/terraform/plugin/discovery" 9 "github.com/hashicorp/terraform/plugin/discovery"
8) 10)
@@ -10,11 +12,18 @@ import (
10// ClientConfig returns a configuration object that can be used to instantiate 12// ClientConfig returns a configuration object that can be used to instantiate
11// a client for the plugin described by the given metadata. 13// a client for the plugin described by the given metadata.
12func ClientConfig(m discovery.PluginMeta) *plugin.ClientConfig { 14func ClientConfig(m discovery.PluginMeta) *plugin.ClientConfig {
15 logger := hclog.New(&hclog.LoggerOptions{
16 Name: "plugin",
17 Level: hclog.Trace,
18 Output: os.Stderr,
19 })
20
13 return &plugin.ClientConfig{ 21 return &plugin.ClientConfig{
14 Cmd: exec.Command(m.Path), 22 Cmd: exec.Command(m.Path),
15 HandshakeConfig: Handshake, 23 HandshakeConfig: Handshake,
16 Managed: true, 24 Managed: true,
17 Plugins: PluginMap, 25 Plugins: PluginMap,
26 Logger: logger,
18 } 27 }
19} 28}
20 29