panic_prevention (#12819)
This commit is contained in:
parent
23bc24bfcc
commit
bbded01863
|
@ -449,15 +449,16 @@ func resourceProfitBricksServerRead(d *schema.ResourceData, meta interface{}) er
|
|||
serverId := d.Id()
|
||||
|
||||
server := profitbricks.GetServer(dcId, serverId)
|
||||
primarynic := d.Get("primary_nic").(string)
|
||||
|
||||
d.Set("name", server.Properties.Name)
|
||||
d.Set("cores", server.Properties.Cores)
|
||||
d.Set("ram", server.Properties.Ram)
|
||||
d.Set("availability_zone", server.Properties.AvailabilityZone)
|
||||
d.Set("primary_nic", primarynic)
|
||||
|
||||
nic := profitbricks.GetNic(dcId, serverId, primarynic)
|
||||
if primarynic, ok := d.GetOk("primary_nic"); ok {
|
||||
d.Set("primary_nic", primarynic.(string))
|
||||
|
||||
nic := profitbricks.GetNic(dcId, serverId, primarynic.(string))
|
||||
|
||||
if len(nic.Properties.Ips) > 0 {
|
||||
d.Set("primary_ip", nic.Properties.Ips[0])
|
||||
|
@ -481,6 +482,7 @@ func resourceProfitBricksServerRead(d *schema.ResourceData, meta interface{}) er
|
|||
}
|
||||
d.Set("nic", nicRaw)
|
||||
}
|
||||
}
|
||||
|
||||
if server.Properties.BootVolume != nil {
|
||||
d.Set("boot_volume", server.Properties.BootVolume.Id)
|
||||
|
|
Loading…
Reference in New Issue