diff --git a/builder/alicloud/ecs/packer_helper.go b/builder/alicloud/ecs/packer_helper.go index f88f6ff1a..2486b81cf 100644 --- a/builder/alicloud/ecs/packer_helper.go +++ b/builder/alicloud/ecs/packer_helper.go @@ -14,9 +14,9 @@ func message(state multistep.StateBag, module string) { ui := state.Get("ui").(packer.Ui) if cancelled || halted { - ui.Say(fmt.Sprintf("Delete the %s because cancellation or error...", module)) + ui.Say(fmt.Sprintf("Deleting %s because of cancellation or error...", module)) } else { - ui.Say(fmt.Sprintf("Clean the created %s", module)) + ui.Say(fmt.Sprintf("Cleaning up '%s'", module)) } } diff --git a/builder/alicloud/ecs/step_config_eip.go b/builder/alicloud/ecs/step_config_eip.go index 901d66603..b0845ba2a 100644 --- a/builder/alicloud/ecs/step_config_eip.go +++ b/builder/alicloud/ecs/step_config_eip.go @@ -66,14 +66,14 @@ func (s *setpConfigAlicloudEIP) Cleanup(state multistep.StateBag) { message(state, "EIP") if err := client.UnassociateEipAddress(s.allocatedId, instance.InstanceId); err != nil { - ui.Say(fmt.Sprintf("Unassociating eip failed.")) + ui.Say(fmt.Sprintf("Failed to unassociate eip.")) } if err := client.WaitForEip(common.Region(s.RegionId), s.allocatedId, ecs.EipStatusAvailable, ALICLOUD_DEFAULT_SHORT_TIMEOUT); err != nil { ui.Say(fmt.Sprintf("Timeout while unassociating eip.")) } if err := client.ReleaseEipAddress(s.allocatedId); err != nil { - ui.Say(fmt.Sprintf("Releasing eip failed.")) + ui.Say(fmt.Sprintf("Failed to release eip.")) } } diff --git a/builder/alicloud/ecs/step_config_key_pair.go b/builder/alicloud/ecs/step_config_key_pair.go index 6e1276dcc..22ccd28b6 100644 --- a/builder/alicloud/ecs/step_config_key_pair.go +++ b/builder/alicloud/ecs/step_config_key_pair.go @@ -43,7 +43,7 @@ func (s *StepConfigAlicloudKeyPair) Run(state multistep.StateBag) multistep.Step } if s.SSHAgentAuth && s.KeyPairName == "" { - ui.Say("Using SSH Agent with key pair in Source AlicloudImage") + ui.Say("Using SSH Agent with key pair in source image") return multistep.ActionContinue } @@ -61,7 +61,7 @@ func (s *StepConfigAlicloudKeyPair) Run(state multistep.StateBag) multistep.Step client := state.Get("client").(*ecs.Client) - ui.Say(fmt.Sprintf("Start creating temporary keypair: %s", s.TemporaryKeyPairName)) + ui.Say(fmt.Sprintf("Creating temporary keypair: %s", s.TemporaryKeyPairName)) keyResp, err := client.CreateKeyPair(&ecs.CreateKeyPairArgs{ KeyPairName: s.TemporaryKeyPairName, RegionId: common.Region(s.RegionId), diff --git a/builder/alicloud/ecs/step_config_public_ip.go b/builder/alicloud/ecs/step_config_public_ip.go index 6b786bbce..65b7f3fe2 100644 --- a/builder/alicloud/ecs/step_config_public_ip.go +++ b/builder/alicloud/ecs/step_config_public_ip.go @@ -25,7 +25,7 @@ func (s *stepConfigAlicloudPublicIP) Run(state multistep.StateBag) multistep.Ste return multistep.ActionHalt } s.publicIPAdress = ipaddress - ui.Say(fmt.Sprintf("allocated public ip address %s", ipaddress)) + ui.Say(fmt.Sprintf("Allocated public ip address %s.", ipaddress)) state.Put("ipaddress", ipaddress) return multistep.ActionContinue } diff --git a/builder/alicloud/ecs/step_config_security_group.go b/builder/alicloud/ecs/step_config_security_group.go index 90bdda9d5..6bfbb386a 100644 --- a/builder/alicloud/ecs/step_config_security_group.go +++ b/builder/alicloud/ecs/step_config_security_group.go @@ -60,7 +60,7 @@ func (s *stepConfigAlicloudSecurityGroup) Run(state multistep.StateBag) multiste } var securityGroupId string - ui.Say("Start creating security groups...") + ui.Say("Creating security groups...") if networkType == VpcNet { vpcId := state.Get("vpcid").(string) securityGroupId, err = client.CreateSecurityGroup(&ecs.CreateSecurityGroupArgs{ @@ -76,7 +76,7 @@ func (s *stepConfigAlicloudSecurityGroup) Run(state multistep.StateBag) multiste } if err != nil { state.Put("error", err) - ui.Say(fmt.Sprintf("Create security group failed %s", err)) + ui.Say(fmt.Sprintf("Failed creating security group %s.", err)) return multistep.ActionHalt } state.Put("securitygroupid", securityGroupId) diff --git a/builder/alicloud/ecs/step_config_vpc.go b/builder/alicloud/ecs/step_config_vpc.go index a0ceb03b1..0dce325a4 100644 --- a/builder/alicloud/ecs/step_config_vpc.go +++ b/builder/alicloud/ecs/step_config_vpc.go @@ -45,7 +45,7 @@ func (s *stepConfigAlicloudVPC) Run(state multistep.StateBag) multistep.StepActi return multistep.ActionHalt } - ui.Say("Start create vpc") + ui.Say("Creating vpc") vpc, err := client.CreateVpc(&ecs.CreateVpcArgs{ RegionId: common.Region(config.AlicloudRegion), CidrBlock: s.CidrBlock, @@ -53,13 +53,13 @@ func (s *stepConfigAlicloudVPC) Run(state multistep.StateBag) multistep.StepActi }) if err != nil { state.Put("error", err) - ui.Say(fmt.Sprintf("Create vpc failed %s", err)) + ui.Say(fmt.Sprintf("Failed creating vpc: %s", err)) return multistep.ActionHalt } err = client.WaitForVpcAvailable(common.Region(config.AlicloudRegion), vpc.VpcId, ALICLOUD_DEFAULT_SHORT_TIMEOUT) if err != nil { state.Put("error", err) - ui.Say(fmt.Sprintf("Failed waiting for vpc to become available %s", err)) + ui.Say(fmt.Sprintf("Failed waiting for vpc to become available: %s", err)) return multistep.ActionHalt } diff --git a/builder/alicloud/ecs/step_config_vswitch.go b/builder/alicloud/ecs/step_config_vswitch.go index b7c062db2..0705fb45a 100644 --- a/builder/alicloud/ecs/step_config_vswitch.go +++ b/builder/alicloud/ecs/step_config_vswitch.go @@ -80,18 +80,18 @@ func (s *stepConfigAlicloudVSwitch) Run(state multistep.StateBag) multistep.Step if len(instanceTypes) > 0 { ui.Say(fmt.Sprintf("The instance type %s isn't available in this region."+ "\n You can either change the instance to one of following: %v \n"+ - "or choose another region", config.InstanceType, instanceTypes)) + "or choose another region.", config.InstanceType, instanceTypes)) state.Put("error", fmt.Errorf("The instance type %s isn't available in this region."+ "\n You can either change the instance to one of following: %v \n"+ - "or choose another region", config.InstanceType, instanceTypes)) + "or choose another region.", config.InstanceType, instanceTypes)) return multistep.ActionHalt } else { ui.Say(fmt.Sprintf("The instance type %s isn't available in this region."+ - "\n You can change to other regions \n", config.InstanceType)) + "\n You can change to other regions.", config.InstanceType)) state.Put("error", fmt.Errorf("The instance type %s isn't available in this region."+ - "\n You can change to other regions \n", config.InstanceType)) + "\n You can change to other regions.", config.InstanceType)) return multistep.ActionHalt } } @@ -99,7 +99,7 @@ func (s *stepConfigAlicloudVSwitch) Run(state multistep.StateBag) multistep.Step if config.CidrBlock == "" { s.CidrBlock = "172.16.0.0/24" //use the default CirdBlock } - ui.Say("Start creating vswitch...") + ui.Say("Creating vswitch...") vswitchId, err := client.CreateVSwitch(&ecs.CreateVSwitchArgs{ CidrBlock: s.CidrBlock, ZoneId: s.ZoneId, diff --git a/builder/alicloud/ecs/step_create_instance.go b/builder/alicloud/ecs/step_create_instance.go index 728772999..0b8f85e4c 100644 --- a/builder/alicloud/ecs/step_create_instance.go +++ b/builder/alicloud/ecs/step_create_instance.go @@ -43,7 +43,7 @@ func (s *stepCreateAlicloudInstance) Run(state multistep.StateBag) multistep.Ste if password == "" && config.Comm.WinRMPassword != "" { password = config.Comm.WinRMPassword } - ui.Say("Start creating alicloud instance") + ui.Say("Creating instance.") if network_type == VpcNet { userData, err := s.getUserData(state) if err != nil { @@ -127,7 +127,7 @@ func (s *stepCreateAlicloudInstance) Cleanup(state multistep.StateBag) { ui := state.Get("ui").(packer.Ui) err := client.DeleteInstance(s.instance.InstanceId) if err != nil { - ui.Say(fmt.Sprintf("Cleaning instance %s failed ", s.instance.InstanceId)) + ui.Say(fmt.Sprintf("Failed to clean up instance %s: ", s.instance.InstanceId, err.Error())) } } diff --git a/builder/alicloud/ecs/step_delete_images_snapshots.go b/builder/alicloud/ecs/step_delete_images_snapshots.go index e2dd10988..24104fef0 100644 --- a/builder/alicloud/ecs/step_delete_images_snapshots.go +++ b/builder/alicloud/ecs/step_delete_images_snapshots.go @@ -20,7 +20,7 @@ func (s *stepDeleteAlicloudImageSnapshots) Run(state multistep.StateBag) multist client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(Config) - ui.Say("Start delete alicloud image snapshots") + ui.Say("Deleting image snapshots.") // Check for force delete if s.AlicloudImageForceDetele { images, _, err := client.DescribeImages(&ecs.DescribeImagesArgs{ @@ -32,7 +32,7 @@ func (s *stepDeleteAlicloudImageSnapshots) Run(state multistep.StateBag) multist } for _, image := range images { if image.ImageOwnerAlias != string(ecs.ImageOwnerSelf) { - log.Printf("Only can delete the instance based on customized images %s ", image.ImageId) + log.Printf("You can only delete instances based on customized images %s ", image.ImageId) continue } err = client.DeleteImage(common.Region(config.AlicloudRegion), image.ImageId) diff --git a/builder/alicloud/ecs/step_mount_disk.go b/builder/alicloud/ecs/step_mount_disk.go index 8d97e7233..222b27f08 100644 --- a/builder/alicloud/ecs/step_mount_disk.go +++ b/builder/alicloud/ecs/step_mount_disk.go @@ -20,7 +20,7 @@ func (s *stepMountAlicloudDisk) Run(state multistep.StateBag) multistep.StepActi if len(config.ECSImagesDiskMappings) == 0 { return multistep.ActionContinue } - ui.Say("Start mounting Disks") + ui.Say("Mounting disks.") disks, _, err := client.DescribeDisks(&ecs.DescribeDisksArgs{InstanceId: instance.InstanceId, RegionId: instance.RegionId}) if err != nil { @@ -50,7 +50,7 @@ func (s *stepMountAlicloudDisk) Run(state multistep.StateBag) multistep.StepActi return multistep.ActionHalt } } - ui.Say("Finished mounting disks") + ui.Say("Finished mounting disks.") return multistep.ActionContinue } diff --git a/builder/alicloud/ecs/step_pre_validate.go b/builder/alicloud/ecs/step_pre_validate.go index 12d8e098f..527d84fbf 100644 --- a/builder/alicloud/ecs/step_pre_validate.go +++ b/builder/alicloud/ecs/step_pre_validate.go @@ -17,13 +17,13 @@ type stepPreValidate struct { func (s *stepPreValidate) Run(state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.ForceDelete { - ui.Say("Force delete flag found, skipping prevalidating alicloud image name") + ui.Say("Force delete flag found, skipping prevalidating image name.") return multistep.ActionContinue } client := state.Get("client").(*ecs.Client) config := state.Get("config").(Config) - ui.Say("Prevalidating alicloud image name...") + ui.Say("Prevalidating image name...") images, _, err := client.DescribeImages(&ecs.DescribeImagesArgs{ ImageName: s.AlicloudDestImageName, RegionId: common.Region(config.AlicloudRegion)}) diff --git a/builder/alicloud/ecs/step_region_copy_image.go b/builder/alicloud/ecs/step_region_copy_image.go index 7fabefc8d..5f60cafab 100644 --- a/builder/alicloud/ecs/step_region_copy_image.go +++ b/builder/alicloud/ecs/step_region_copy_image.go @@ -58,17 +58,14 @@ func (s *setpRegionCopyAlicloudImage) Cleanup(state multistep.StateBag) { ui := state.Get("ui").(packer.Ui) client := state.Get("client").(*ecs.Client) alicloudImages := state.Get("alicloudimages").(map[string]string) - ui.Say(fmt.Sprintf("Cancel copy image because cancellation or error...")) + ui.Say(fmt.Sprintf("Stopping copy image because cancellation or error...")) for copyedRegionId, copyedImageId := range alicloudImages { if copyedRegionId == s.RegionId { continue } if err := client.CancelCopyImage(common.Region(copyedRegionId), copyedImageId); err != nil { - ui.Say(fmt.Sprintf("Cancel copy image has error %v", err)) + ui.Say(fmt.Sprintf("Error cancelling copy image: %v", err)) } - } - } - } diff --git a/builder/alicloud/ecs/step_run_instance.go b/builder/alicloud/ecs/step_run_instance.go index 0288a0c93..5290646d6 100644 --- a/builder/alicloud/ecs/step_run_instance.go +++ b/builder/alicloud/ecs/step_run_instance.go @@ -23,7 +23,7 @@ func (s *stepRunAlicloudInstance) Run(state multistep.StateBag) multistep.StepAc ui.Error(err.Error()) return multistep.ActionHalt } - ui.Say("Alcoud instance starting") + ui.Say("Starting instance.") err = client.WaitForInstance(instance.InstanceId, ecs.Running, ALICLOUD_DEFAULT_TIMEOUT) if err != nil { err := fmt.Errorf("Timeout waiting for instance to start: %s", err)