Skip to content

Commit 4de3f27

Browse files
authored
Merge pull request #564 from atombrella/feature/ui_say
Replace deprecated ui.Message with ui.Say
2 parents 5207881 + e2668b6 commit 4de3f27

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

builder/azure/arm/builder.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
120120
OidcRequestToken: b.config.ClientConfig.OidcRequestToken,
121121
}
122122

123-
ui.Message("Creating Azure Resource Manager (ARM) client ...")
123+
ui.Say("Creating Azure Resource Manager (ARM) client ...")
124124
azureClient, err := NewAzureClient(
125125
ctx,
126126
b.config.StorageAccount,
@@ -132,7 +132,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
132132
if err != nil {
133133
return nil, err
134134
}
135-
ui.Message("ARM Client successfully created")
135+
ui.Say("ARM Client successfully created")
136136

137137
resolver := newResourceResolver(azureClient)
138138
if err := resolver.Resolve(&b.config); err != nil {
@@ -145,7 +145,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
145145
if b.config.ClientConfig.ObjectID == "" {
146146
b.config.ClientConfig.ObjectID = objectID
147147
} else {
148-
ui.Message("You have provided Object_ID which is no longer needed, Azure Packer ARM builder determines this automatically using the Azure Access Token")
148+
ui.Say("You have provided Object_ID which is no longer needed, Azure Packer ARM builder determines this automatically using the Azure Access Token")
149149
}
150150

151151
if b.config.ClientConfig.ObjectID == "" && b.config.OSType != constants.Target_Linux {
@@ -155,7 +155,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
155155
// If the user is bringing their own vnet, don't warn, if its an invalid SKU it will get disabled at a different date and Microsoft will send out warings
156156
if b.config.VirtualNetworkName == "" {
157157
if b.config.PublicIpSKU == string(publicipaddresses.PublicIPAddressSkuNameBasic) {
158-
ui.Message(publicIPWarning)
158+
ui.Say(publicIPWarning)
159159
}
160160
}
161161

@@ -422,7 +422,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
422422
}
423423

424424
if b.config.SkipCreateBuildKeyVault {
425-
ui.Message("Skipping build keyvault creation...")
425+
ui.Say("Skipping build keyvault creation...")
426426
} else if b.config.BuildKeyVaultName == "" {
427427
keyVaultDeploymentName := b.stateBag.Get(constants.ArmKeyVaultDeploymentName).(string)
428428
steps = append(steps,
@@ -513,12 +513,12 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
513513
steps = append(steps, captureSteps...)
514514

515515
if b.config.PackerDebug {
516-
ui.Message(fmt.Sprintf("temp admin user: '%s'", b.config.UserName))
517-
ui.Message(fmt.Sprintf("temp admin password: '%s'", b.config.Password))
516+
ui.Say(fmt.Sprintf("temp admin user: '%s'", b.config.UserName))
517+
ui.Say(fmt.Sprintf("temp admin password: '%s'", b.config.Password))
518518

519519
if len(b.config.Comm.SSHPrivateKey) != 0 {
520520
debugKeyPath := fmt.Sprintf("%s-%s.pem", b.config.PackerBuildName, b.config.tmpComputeName)
521-
ui.Message(fmt.Sprintf("temp ssh key: %s", debugKeyPath))
521+
ui.Say(fmt.Sprintf("temp ssh key: %s", debugKeyPath))
522522

523523
b.writeSSHPrivateKey(ui, debugKeyPath)
524524
}

builder/azure/dtl/builder.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
8484
OidcRequestUrl: b.config.ClientConfig.OidcRequestURL,
8585
OidcRequestToken: b.config.ClientConfig.OidcRequestToken,
8686
}
87-
ui.Message("Creating Azure DevTestLab (DTL) client ...")
87+
ui.Say("Creating Azure DevTestLab (DTL) client ...")
8888
azureClient, err := NewAzureClient(
8989
ctx,
9090
b.config.ClientConfig.SubscriptionID,
@@ -106,7 +106,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
106106
if b.config.ClientConfig.ObjectID == "" {
107107
b.config.ClientConfig.ObjectID = objectId
108108
} else {
109-
ui.Message("You have provided Object_ID which is no longer needed, azure packer builder determines this dynamically from the authentication token")
109+
ui.Say("You have provided Object_ID which is no longer needed, azure packer builder determines this dynamically from the authentication token")
110110
}
111111

112112
if b.config.ClientConfig.ObjectID == "" && b.config.OSType != constants.Target_Linux {
@@ -191,7 +191,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
191191
b.config.LabVirtualNetworkName = *virtualNetwork
192192
b.config.LabSubnetName = *subnet
193193

194-
ui.Message(fmt.Sprintf("No lab network information provided. Using %s Virtual network and %s subnet for Virtual Machine creation", b.config.LabVirtualNetworkName, b.config.LabSubnetName))
194+
ui.Say(fmt.Sprintf("No lab network information provided. Using %s Virtual network and %s subnet for Virtual Machine creation", b.config.LabVirtualNetworkName, b.config.LabSubnetName))
195195
}
196196

197197
if b.config.OSType == constants.Target_Linux {
@@ -244,12 +244,12 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
244244
steps = append(steps, NewStepDeleteVirtualMachine(azureClient, ui, &b.config))
245245

246246
if b.config.PackerDebug {
247-
ui.Message(fmt.Sprintf("temp admin user: '%s'", b.config.UserName))
248-
ui.Message(fmt.Sprintf("temp admin password: '%s'", b.config.Password))
247+
ui.Say(fmt.Sprintf("temp admin user: '%s'", b.config.UserName))
248+
ui.Say(fmt.Sprintf("temp admin password: '%s'", b.config.Password))
249249

250250
if len(b.config.Comm.SSHPrivateKey) != 0 {
251251
debugKeyPath := fmt.Sprintf("%s-%s.pem", b.config.PackerBuildName, b.config.tmpComputeName)
252-
ui.Message(fmt.Sprintf("temp ssh key: %s", debugKeyPath))
252+
ui.Say(fmt.Sprintf("temp ssh key: %s", debugKeyPath))
253253

254254
b.writeSSHPrivateKey(ui, debugKeyPath)
255255
}

provisioner/azure-dtlartifact/provisioner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packe
135135
TenantID: p.config.ClientConfig.TenantID,
136136
SubscriptionID: p.config.ClientConfig.SubscriptionID,
137137
}
138-
ui.Message("Creating Azure DevTestLab (DTL) client ...")
138+
ui.Say("Creating Azure DevTestLab (DTL) client ...")
139139
azureClient, err := dtlBuilder.NewAzureClient(
140140
ctx,
141141
p.config.ClientConfig.SubscriptionID,

0 commit comments

Comments
 (0)