Fixes per code review

This commit is contained in:
Patrick Double 2018-08-09 07:14:14 -05:00
parent d796edc783
commit 2868971a9b
2 changed files with 4 additions and 9 deletions

View File

@ -254,14 +254,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
return nil, errors.New("Build was halted.") return nil, errors.New("Build was halted.")
} }
osType := "Linux"
if b.config.OSType == constants.Target_Windows {
osType = "Windows"
}
if b.config.isManagedImage() { if b.config.isManagedImage() {
managedImageID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/images/%s", b.config.SubscriptionID, b.config.ManagedImageResourceGroupName, b.config.ManagedImageName) managedImageID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/images/%s", b.config.SubscriptionID, b.config.ManagedImageResourceGroupName, b.config.ManagedImageName)
return NewManagedImageArtifact(osType, b.config.ManagedImageResourceGroupName, b.config.ManagedImageName, b.config.manageImageLocation, managedImageID) return NewManagedImageArtifact(b.config.OSType, b.config.ManagedImageResourceGroupName, b.config.ManagedImageName, b.config.manageImageLocation, managedImageID)
} else if template, ok := b.stateBag.GetOk(constants.ArmCaptureTemplate); ok { } else if template, ok := b.stateBag.GetOk(constants.ArmCaptureTemplate); ok {
return NewArtifact( return NewArtifact(
template.(*CaptureTemplate), template.(*CaptureTemplate),
@ -273,7 +268,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
sasUrl, _ := blob.GetSASURI(options) sasUrl, _ := blob.GetSASURI(options)
return sasUrl return sasUrl
}, },
osType) b.config.OSType)
} }
return &Artifact{}, nil return &Artifact{}, nil

View File

@ -31,8 +31,8 @@ Currently, the Vagrant post-processor can create boxes for the following
providers. providers.
- AWS - AWS
- Azure
- DigitalOcean - DigitalOcean
- Google
- Azure - Azure
- Hyper-V - Hyper-V
- LXC - LXC
@ -107,9 +107,9 @@ where it will be set to 0.
The available provider names are: The available provider names are:
- `aws` - `aws`
- `azure`
- `digitalocean` - `digitalocean`
- `google` - `google`
- `azure`
- `hyperv` - `hyperv`
- `parallels` - `parallels`
- `libvirt` - `libvirt`