From 7cc359ec59532131ecfcbe960d01a0750618cbb7 Mon Sep 17 00:00:00 2001 From: kjubybot Date: Thu, 7 Jul 2022 12:50:38 +0300 Subject: [PATCH 1/2] v2.4.0 --- CHANGELOG.md | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88fa8aa..761dc84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,37 +1,2 @@ -### Bug fixes -- changing boot\_disk\_size in kvmvm -- downsizing CPU and RAM in kvmvm -- pfw recreation if public\_port\_end unspecified -- uninformative error message when retrying on 500 -- hardcoded 3 minute timeout - -### New datasources -- disk\_list -- rg\_list -- account\_list -- account\_computes\_list -- account\_disks\_list -- account\_vins\_list -- account\_audits\_list -- account -- account\_rg\_list -- account\_counsumed\_units -- account\_counsumed\_units\_by\_type -- account\_reserved\_units -- account\_templates\_list -- account\_deleted\_list -- bservice\_list -- bservice\_snapshot\_list -- bservice\_deleted\_list -- bservice -- bservice\_group -- extnet\_default -- extnet\_list -- extnet -- extnet\_computes\_list -- vins\_list - -### New resources -- account -- bservice -- bservice\_group +### Resources updated +- kvmvm - added sep\_id and pool parameters From 020845b48fd7869f383287f0cc0599abf4fc942f Mon Sep 17 00:00:00 2001 From: kjubybot Date: Fri, 15 Jul 2022 18:21:24 +0300 Subject: [PATCH 2/2] fixed compute boot disk reading --- decort/data_source_compute.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/decort/data_source_compute.go b/decort/data_source_compute.go index 25f77c8..4af762c 100644 --- a/decort/data_source_compute.go +++ b/decort/data_source_compute.go @@ -26,7 +26,6 @@ package decort import ( "encoding/json" - "errors" "fmt" // "net/url" @@ -97,14 +96,15 @@ func parseBootDiskId(disks []DiskRecord) uint { return 0 } -func findBootDisk(disks []DiskRecord) (*DiskRecord, error) { +func findBootDisk(disks []DiskRecord) *DiskRecord { for _, d := range disks { if d.Type == "B" { - return &d, nil + return &d } } - return nil, errors.New("boot disk not found") + // some computes don't have a boot disk, so... + return &DiskRecord{} } // Parse the list of interfaces from compute/get response into a list of networks @@ -171,10 +171,7 @@ func flattenCompute(d *schema.ResourceData, compFacts string) error { d.Set("started", false) } - bootDisk, err := findBootDisk(model.Disks) - if err != nil { - return err - } + bootDisk := findBootDisk(model.Disks) d.Set("boot_disk_size", bootDisk.SizeMax) d.Set("boot_disk_id", bootDisk.ID) // we may need boot disk ID in resize operations