4.9.9
This commit is contained in:
@@ -276,10 +276,6 @@ func flattenBootDisk(bootDisk *compute.ItemComputeDisk) []map[string]interface{}
|
||||
func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, extraDisks []interface{}, bootDiskId uint64) []map[string]interface{} {
|
||||
res := make([]map[string]interface{}, 0, len(disksList))
|
||||
|
||||
if len(disksBlocks) == 0 {
|
||||
return res
|
||||
}
|
||||
|
||||
sort.Slice(disksList, func(i, j int) bool {
|
||||
return disksList[i].ID < disksList[j].ID
|
||||
})
|
||||
@@ -291,7 +287,11 @@ func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, ex
|
||||
continue
|
||||
}
|
||||
|
||||
pernamentlyValue := disksBlocks[indexDataDisks].(map[string]interface{})["permanently"].(bool)
|
||||
permanentlyValue := false
|
||||
|
||||
if indexDataDisks < len(disksBlocks) {
|
||||
permanentlyValue = disksBlocks[indexDataDisks].(map[string]interface{})["permanently"].(bool)
|
||||
}
|
||||
|
||||
temp := map[string]interface{}{
|
||||
"disk_name": disk.Name,
|
||||
@@ -305,7 +305,7 @@ func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, ex
|
||||
"desc": disk.Description,
|
||||
"image_id": disk.ImageID,
|
||||
"size": disk.SizeMax,
|
||||
"permanently": pernamentlyValue,
|
||||
"permanently": permanentlyValue,
|
||||
"present_to": disk.PresentTo,
|
||||
}
|
||||
res = append(res, temp)
|
||||
|
||||
Reference in New Issue
Block a user