azure: change literal to constant
This commit is contained in:
parent
2684153cb2
commit
ee767e55d1
|
@ -10,6 +10,10 @@ import (
|
||||||
"github.com/mitchellh/multistep"
|
"github.com/mitchellh/multistep"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
maxResourcesToDelete = 50
|
||||||
|
)
|
||||||
|
|
||||||
type StepDeleteResourceGroup struct {
|
type StepDeleteResourceGroup struct {
|
||||||
client *AzureClient
|
client *AzureClient
|
||||||
delete func(state multistep.StateBag, resourceGroupName string, cancelCh <-chan struct{}) error
|
delete func(state multistep.StateBag, resourceGroupName string, cancelCh <-chan struct{}) error
|
||||||
|
@ -34,7 +38,7 @@ func (s *StepDeleteResourceGroup) deleteResourceGroup(state multistep.StateBag,
|
||||||
s.say("\nThe resource group was not created by Packer, only deleting individual resources ...")
|
s.say("\nThe resource group was not created by Packer, only deleting individual resources ...")
|
||||||
var deploymentName = state.Get(constants.ArmDeploymentName).(string)
|
var deploymentName = state.Get(constants.ArmDeploymentName).(string)
|
||||||
if deploymentName != "" {
|
if deploymentName != "" {
|
||||||
maxResources := int32(50)
|
maxResources := int32(maxResourcesToDelete)
|
||||||
deploymentOperations, err := s.client.DeploymentOperationsClient.List(resourceGroupName, deploymentName, &maxResources)
|
deploymentOperations, err := s.client.DeploymentOperationsClient.List(resourceGroupName, deploymentName, &maxResources)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.say(fmt.Sprintf("Error deleting resources. Please delete them manually.\n\n"+
|
s.say(fmt.Sprintf("Error deleting resources. Please delete them manually.\n\n"+
|
||||||
|
|
Loading…
Reference in New Issue