From 47045658699ade320a34dbfafc400d110fb4c69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Sm=C3=B3=C5=82ka?= Date: Fri, 1 Feb 2019 18:57:43 +0100 Subject: [PATCH] Rename vm_flavour to vm_type --- builder/hyperone/builder_acc_test.go | 2 +- builder/hyperone/config.go | 10 +++++----- builder/hyperone/step_create_vm.go | 2 +- builder/hyperone/step_create_vm_from_disk.go | 2 +- website/source/docs/builders/hyperone.html.md | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/builder/hyperone/builder_acc_test.go b/builder/hyperone/builder_acc_test.go index 1c27c3363..e60736278 100644 --- a/builder/hyperone/builder_acc_test.go +++ b/builder/hyperone/builder_acc_test.go @@ -25,7 +25,7 @@ const testBuilderAccBasic = ` { "builders": [{ "type": "test", - "vm_flavour": "a1.nano", + "vm_type": "a1.nano", "source_image": "5c3fef425ceadc3d412beee5", "disk_size": 10 }] diff --git a/builder/hyperone/config.go b/builder/hyperone/config.go index 102517420..5d1c6b512 100644 --- a/builder/hyperone/config.go +++ b/builder/hyperone/config.go @@ -45,9 +45,9 @@ type Config struct { ImageTags map[string]interface{} `mapstructure:"image_tags"` ImageService string `mapstructure:"image_service"` - VmFlavour string `mapstructure:"vm_flavour"` - VmName string `mapstructure:"vm_name"` - VmTags map[string]interface{} `mapstructure:"vm_tags"` + VmType string `mapstructure:"vm_type"` + VmName string `mapstructure:"vm_name"` + VmTags map[string]interface{} `mapstructure:"vm_tags"` DiskName string `mapstructure:"disk_name"` DiskType string `mapstructure:"disk_type"` @@ -207,8 +207,8 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) { errs = packer.MultiErrorAppend(errs, errors.New("token is required")) } - if c.VmFlavour == "" { - errs = packer.MultiErrorAppend(errs, errors.New("vm flavour is required")) + if c.VmType == "" { + errs = packer.MultiErrorAppend(errs, errors.New("vm type is required")) } if c.DiskSize == 0 { diff --git a/builder/hyperone/step_create_vm.go b/builder/hyperone/step_create_vm.go index 7da448be9..932877846 100644 --- a/builder/hyperone/step_create_vm.go +++ b/builder/hyperone/step_create_vm.go @@ -48,7 +48,7 @@ func (s *stepCreateVM) Run(ctx context.Context, state multistep.StateBag) multis options := openapi.VmCreate{ Name: config.VmName, Image: config.SourceImage, - Service: config.VmFlavour, + Service: config.VmType, SshKeys: sshKeys, Disk: disks, Netadp: []openapi.VmCreateNetadp{netAdapter}, diff --git a/builder/hyperone/step_create_vm_from_disk.go b/builder/hyperone/step_create_vm_from_disk.go index 9542c2849..abc2b87dc 100644 --- a/builder/hyperone/step_create_vm_from_disk.go +++ b/builder/hyperone/step_create_vm_from_disk.go @@ -24,7 +24,7 @@ func (s *stepCreateVMFromDisk) Run(ctx context.Context, state multistep.StateBag options := openapi.VmCreate{ Name: config.VmName, - Service: config.VmFlavour, + Service: config.VmType, Disk: []openapi.VmCreateDisk{ { Id: chrootDiskID, diff --git a/website/source/docs/builders/hyperone.html.md b/website/source/docs/builders/hyperone.html.md index 9a34a9c04..bdcb5bb7e 100644 --- a/website/source/docs/builders/hyperone.html.md +++ b/website/source/docs/builders/hyperone.html.md @@ -108,7 +108,7 @@ builder. - In `~/.h1-cli/conf.json` config file used by [h1-cli](https://github.com/hyperonecom/h1-cli). - By using SSH authentication if `token_login` variable has been set. -- `vm_flavour` (string) - ID or name of the type this server should be created with. +- `vm_type` (string) - ID or name of the type this server should be created with. ### Optional: @@ -215,7 +215,7 @@ token. "type": "hyperone", "token": "YOUR_AUTH_TOKEN", "source_image": "ubuntu-18.04", - "vm_flavour": "a1.nano", + "vm_type": "a1.nano", "disk_size": 10 } ``` @@ -228,7 +228,7 @@ token. "type": "hyperone", "token": "YOUR_AUTH_TOKEN", "source_image": "ubuntu-18.04", - "vm_flavour": "a1.nano", + "vm_type": "a1.nano", "disk_size": 10, "chroot_disk": true, "pre_mount_commands": [