export 'region' from 'Read' operations

This commit is contained in:
Jon Perritt 2015-01-26 11:58:19 -07:00
parent 46a7949c9d
commit 2214331b3c
10 changed files with 11 additions and 0 deletions

View File

@ -198,6 +198,7 @@ func resourceComputeInstanceV2Read(d *schema.ResourceData, meta interface{}) err
log.Printf("[DEBUG] Retreived Server %s: %+v", d.Id(), server)
d.Set("region", d.Get("region").(string))
d.Set("name", server.Name)
d.Set("access_ip_v4", server.AccessIPv4)
d.Set("access_ip_v6", server.AccessIPv6)

View File

@ -74,6 +74,7 @@ func resourceComputeKeypairV2Read(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Error retrieving OpenStack keypair: %s", err)
}
d.Set("region", d.Get("region").(string))
d.Set("name", kp.Name)
d.Set("public_key", kp.PublicKey)

View File

@ -76,6 +76,7 @@ func resourceComputeSecGroupV2Read(d *schema.ResourceData, meta interface{}) err
return fmt.Errorf("Error retrieving OpenStack security group: %s", err)
}
d.Set("region", d.Get("region").(string))
d.Set("name", sg.Name)
d.Set("description", sg.Description)

View File

@ -80,6 +80,7 @@ func resourceComputeSecGroupRuleV2Create(d *schema.ResourceData, meta interface{
}
d.SetId(sgr.ID)
d.Set("region", d.Get("region").(string))
d.Set("group_id", sgr.ParentGroupID)
d.Set("from_port", sgr.FromPort)
d.Set("to_port", sgr.ToPort)

View File

@ -97,6 +97,7 @@ func resourceLBMemberV1Read(d *schema.ResourceData, meta interface{}) error {
log.Printf("[DEBUG] Retreived OpenStack LB Member %s: %+v", d.Id(), p)
d.Set("region", d.Get("region").(string))
d.Set("address", p.Address)
d.Set("port", p.ProtocolPort)
d.Set("pool_id", p.PoolID)

View File

@ -131,6 +131,7 @@ func resourceLBMonitorV1Read(d *schema.ResourceData, meta interface{}) error {
log.Printf("[DEBUG] Retreived OpenStack LB Monitor %s: %+v", d.Id(), m)
d.Set("region", d.Get("region").(string))
d.Set("type", m.Type)
d.Set("delay", m.Delay)
d.Set("timeout", m.Timeout)

View File

@ -118,6 +118,7 @@ func resourceLBPoolV1Read(d *schema.ResourceData, meta interface{}) error {
log.Printf("[DEBUG] Retreived OpenStack LB Pool %s: %+v", d.Id(), p)
d.Set("region", d.Get("region").(string))
d.Set("name", p.Name)
d.Set("protocol", p.Protocol)
d.Set("subnet_id", p.SubnetID)

View File

@ -143,6 +143,7 @@ func resourceLBVipV1Read(d *schema.ResourceData, meta interface{}) error {
log.Printf("[DEBUG] Retreived OpenStack LB VIP %s: %+v", d.Id(), p)
d.Set("region", d.Get("region").(string))
d.Set("name", p.Name)
d.Set("subnet_id", p.SubnetID)
d.Set("protocol", p.Protocol)

View File

@ -109,6 +109,8 @@ func resourceNetworkingNetworkV2Read(d *schema.ResourceData, meta interface{}) e
log.Printf("[DEBUG] Retreived Network %s: %+v", d.Id(), n)
d.Set("region", d.Get("region").(string))
if _, exists := d.GetOk("name"); exists {
if d.HasChange("name") {
d.Set("name", n.Name)

View File

@ -166,6 +166,7 @@ func resourceNetworkingSubnetV2Read(d *schema.ResourceData, meta interface{}) er
log.Printf("[DEBUG] Retreived Subnet %s: %+v", d.Id(), s)
d.Set("region", d.Get("region").(string))
d.Set("newtork_id", s.NetworkID)
d.Set("cidr", s.CIDR)
d.Set("ip_version", s.IPVersion)