vishesh92 commented on code in PR #285:
URL:
https://github.com/apache/cloudstack-terraform-provider/pull/285#discussion_r2910106625
##########
cloudstack/resource_cloudstack_disk_offering.go:
##########
@@ -72,8 +73,59 @@ func resourceCloudStackDiskOfferingCreate(d
*schema.ResourceData, meta interface
return resourceCloudStackDiskOfferingRead(d, meta)
}
-func resourceCloudStackDiskOfferingRead(d *schema.ResourceData, meta
interface{}) error { return nil }
+func resourceCloudStackDiskOfferingRead(d *schema.ResourceData, meta
interface{}) error {
+ cs := meta.(*cloudstack.CloudStackClient)
+
+ log.Printf("[DEBUG] Retrieving disk offering %s",
d.Get("name").(string))
+
+ offering, count, err := cs.DiskOffering.GetDiskOfferingByID(d.Id())
+ if err != nil {
+ if count == 0 {
+ log.Printf("[DEBUG] Disk offering %s does no longer
exist", d.Get("name").(string))
+ d.SetId("")
+ return nil
+ }
+ return fmt.Errorf("Error retrieving disk offering %s: %s",
d.Id(), err)
+ }
+
+ d.Set("name", offering.Name)
+ d.Set("display_text", offering.Displaytext)
+ d.Set("disk_size", offering.Disksize)
Review Comment:
What about custom disk size?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]