Fixing computed parameters

This commit is contained in:
Joe Topjian 2015-03-24 13:24:04 +00:00
parent ccba698370
commit 0d77232196
1 changed files with 9 additions and 4 deletions

View File

@ -111,26 +111,31 @@ func resourceComputeInstanceV2() *schema.Resource {
"uuid": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"port": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"fixed_ip_v4": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"fixed_ip_v6": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"mac": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},
},
},
@ -361,8 +366,8 @@ func resourceComputeInstanceV2Read(d *schema.ResourceData, meta interface{}) err
hostv4 := server.AccessIPv4
hostv6 := server.AccessIPv6
addresses := resourceInstanceAddresses(server.Addresses)
networkDetails, err := resourceInstanceNetworks(computeClient, d)
addresses := resourceInstanceAddresses(server.Addresses)
if err != nil {
return err
}
@ -424,6 +429,8 @@ func resourceComputeInstanceV2Read(d *schema.ResourceData, meta interface{}) err
}
}
log.Printf("[DEBUG] new networks: %+v", networks)
d.Set("network", networks)
d.Set("access_ip_v4", hostv4)
d.Set("access_ip_v6", hostv6)
@ -790,8 +797,6 @@ func resourceInstanceNetworks(computeClient *gophercloud.ServiceClient, d *schem
}
}
d.Set("network", newNetworks)
log.Printf("[DEBUG] networks: %+v", newNetworks)
return newNetworks, nil