Skip to content

Commit f4c61ef

Browse files
committed
move Ui definition into the packer plugin sdk.
1 parent f185c01 commit f4c61ef

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

builder/tencentcloud/cvm/builder.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/hashicorp/packer/packer-plugin-sdk/common"
1313
"github.com/hashicorp/packer/packer-plugin-sdk/multistep"
1414
"github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps"
15+
packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer"
1516
"github.com/hashicorp/packer/packer-plugin-sdk/template/config"
1617
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
1718
)
@@ -64,7 +65,7 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) {
6465
return nil, nil, nil
6566
}
6667

67-
func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error) {
68+
func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packer.Hook) (packer.Artifact, error) {
6869
cvmClient, vpcClient, err := b.config.Client()
6970
if err != nil {
7071
return nil, err

builder/tencentcloud/cvm/common.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"strings"
88
"time"
99

10-
"github.com/hashicorp/packer/packer"
1110
"github.com/hashicorp/packer/packer-plugin-sdk/multistep"
11+
packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer"
1212
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
1313
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
1414
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
@@ -196,7 +196,7 @@ func Say(state multistep.StateBag, message, prefix string) {
196196
message += "..."
197197
}
198198

199-
ui := state.Get("ui").(packer.Ui)
199+
ui := state.Get("ui").(packersdk.Ui)
200200
ui.Say(message)
201201
}
202202

@@ -206,7 +206,7 @@ func Message(state multistep.StateBag, message, prefix string) {
206206
message = fmt.Sprintf("%s: %s", prefix, message)
207207
}
208208

209-
ui := state.Get("ui").(packer.Ui)
209+
ui := state.Get("ui").(packersdk.Ui)
210210
ui.Message(message)
211211
}
212212

@@ -216,7 +216,7 @@ func Error(state multistep.StateBag, err error, prefix string) {
216216
err = fmt.Errorf("%s: %s", prefix, err)
217217
}
218218

219-
ui := state.Get("ui").(packer.Ui)
219+
ui := state.Get("ui").(packersdk.Ui)
220220
ui.Error(err.Error())
221221
}
222222

0 commit comments

Comments
 (0)