azure: change literal to constant

This commit is contained in:
Christopher Boumenot 2017-11-16 16:36:42 -08:00
parent 2684153cb2
commit ee767e55d1
1 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,10 @@ import (
"github.com/mitchellh/multistep"
)
const (
maxResourcesToDelete = 50
)
type StepDeleteResourceGroup struct {
client *AzureClient
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 ...")
var deploymentName = state.Get(constants.ArmDeploymentName).(string)
if deploymentName != "" {
maxResources := int32(50)
maxResources := int32(maxResourcesToDelete)
deploymentOperations, err := s.client.DeploymentOperationsClient.List(resourceGroupName, deploymentName, &maxResources)
if err != nil {
s.say(fmt.Sprintf("Error deleting resources. Please delete them manually.\n\n"+