4.6.2
This commit is contained in:
@@ -310,7 +310,7 @@ func findBootDisk(disks compute.ListComputeDisks) *compute.ItemComputeDisk {
|
||||
return &compute.ItemComputeDisk{}
|
||||
}
|
||||
|
||||
func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute) error {
|
||||
func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute, pciList *compute.ListPCIDevices) error {
|
||||
// This function expects that compFacts string contains response from API compute/get,
|
||||
// i.e. detailed information about compute instance.
|
||||
//
|
||||
@@ -409,6 +409,7 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute) er
|
||||
}
|
||||
|
||||
d.Set("network", flattenNetwork(computeRec.Interfaces))
|
||||
d.Set("pci_devices", flattenPCI(*pciList))
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -566,7 +567,7 @@ func flattenOsUsers(osUsers compute.ListOSUser) []map[string]interface{} {
|
||||
return res
|
||||
}
|
||||
|
||||
func flattenDataCompute(d *schema.ResourceData, computeRec compute.RecordCompute) {
|
||||
func flattenDataCompute(d *schema.ResourceData, computeRec compute.RecordCompute, pciList *compute.ListPCIDevices) {
|
||||
devices, _ := json.Marshal(computeRec.Devices)
|
||||
userdata, _ := json.Marshal(computeRec.Userdata)
|
||||
d.Set("acl", flattenACL(computeRec.ACL))
|
||||
@@ -637,6 +638,17 @@ func flattenDataCompute(d *schema.ResourceData, computeRec compute.RecordCompute
|
||||
d.Set("vgpus", computeRec.VGPUs)
|
||||
d.Set("virtual_image_id", computeRec.VirtualImageID)
|
||||
d.Set("virtual_image_name", computeRec.VirtualImageName)
|
||||
d.Set("pci_devices", flattenPCI(*pciList))
|
||||
}
|
||||
|
||||
func flattenPCI(pciList compute.ListPCIDevices) []uint64 {
|
||||
res := make([]uint64, 0, len(pciList.Data))
|
||||
|
||||
for _, v := range pciList.Data {
|
||||
res = append(res, v.ID)
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
func flattenComputeAudits(computeAudits compute.ListAudits) []map[string]interface{} {
|
||||
|
||||
Reference in New Issue
Block a user