provisioners/*: new interface

This commit is contained in:
Mitchell Hashimoto 2014-10-04 16:29:33 -07:00
parent 063e727491
commit e5868ebdd9
4 changed files with 9 additions and 3 deletions

View File

@ -13,7 +13,9 @@ import (
type ResourceProvisioner struct{}
func (p *ResourceProvisioner) Apply(s *terraform.InstanceState,
func (p *ResourceProvisioner) Apply(
o terraform.UIOutput,
s *terraform.InstanceState,
c *terraform.ResourceConfig) error {
// Ensure the connection type is SSH
if err := helper.VerifySSH(s); err != nil {

View File

@ -20,6 +20,7 @@ const (
type ResourceProvisioner struct{}
func (p *ResourceProvisioner) Apply(
o terraform.UIOutput,
s *terraform.InstanceState,
c *terraform.ResourceConfig) error {

View File

@ -20,8 +20,9 @@ func TestResourceProvider_Apply(t *testing.T) {
"command": "echo foo > test_out",
})
output := new(terraform.MockUIOutput)
p := new(ResourceProvisioner)
if err := p.Apply(nil, c); err != nil {
if err := p.Apply(output, nil, c); err != nil {
t.Fatalf("err: %v", err)
}

View File

@ -22,7 +22,9 @@ const (
type ResourceProvisioner struct{}
func (p *ResourceProvisioner) Apply(s *terraform.InstanceState,
func (p *ResourceProvisioner) Apply(
o terraform.UIOutput,
s *terraform.InstanceState,
c *terraform.ResourceConfig) error {
// Ensure the connection type is SSH
if err := helper.VerifySSH(s); err != nil {